HEF4067BP 16-channel analogue multiplexer/demultiplexer

used products:

1. Arduino UNO
2. HEF4067BP
3. HP4067

content:

Çeşme: http://labdegaragem.com/forum/topics/bateria-eletr-nica

Arduino:

int selectPins[] = {7,8,9,10}; int ledPins[] = {3,5}; int count = 0; void setup() { Serial.begin(9600); for (int i = 0; i < 4; i++) { pinMode(selectPins[i], OUTPUT); } } void loop() { for (count = 0; count < 2; count++) { for (int i = 0; i < 4; i++) { digitalWrite(selectPins[i], bitRead(count, i)); } int val = analogRead(A0); if (count == 0) { analogWrite(ledPins[count], map(val, 45, 1000, 0, 255)); } else { analogWrite(ledPins[count], map(val, 170, 990, 0, 255)); } Serial.print("pot"); Serial.print(count); Serial.print(":"); Serial.println(val); } delay(200); }