UWSA responsive environments workshop

a platform for discussions & questions

Notes

multiplexing!

hi all (especially Brandon)

i bought a couple of multiplexers (16ch analog, #4607 from creatron)…and got one working!

here is a diagram, a picture and the code to blink an LED on pin y8 (pin 23 on the multiplexer).

s

here is a diagram and a pic and the code:


/*
16 Channel Analog Extender for Arduino
*/

// Set Analog I/O pin to use for reading channel values from multiplexer.
int ComIOpin = 6;  // HEF4067BP(X)(ICpin-01)

// Set which pins tell the multiplexer which input to read from.
int DpinA0 = 10;  // HEF4067BP Address Input A0 (A)(ICpin-10)
int DpinA1 = 11;  // HEF4067BP Address Input A1 (B)(ICpin-11)
int DpinA2 = 12;  // HEF4067BP Address Input A2 (C)(ICpin-14)
int DpinA3 = 13;  // HEF4067BP Address Input A3 (D)(ICpin-13)

void setup() {

// Set the digital pins to outputs.
pinMode(DpinA0, OUTPUT);  // HEF4067BP Address Input A = pin10
pinMode(DpinA1, OUTPUT);  // HEF4067BP Address Input B = pin11
pinMode(DpinA2, OUTPUT);  // HEF4067BP Address Input C = pin12
pinMode(DpinA3, OUTPUT);  // HEF4067BP Address Input D = pin13


pinMode(comIOpin, OUTPUT);

Serial.begin(9600); // Set Serial COM

}

void loop() {
digitalWrite(DpinA0, LOW);
digitalWrite(DpinA1, LOW);
digitalWrite(DpinA2, LOW);
digitalWrite(DpinA3, HIGH);
analogWrite(ComIOpin, 255;
delay(500);
analogWrite(ComIOpin, 0);
delay(500);
}

Filed under arduino question multiplexer