Go Down

Topic: New tutorial - Arduino and the 74HC4067 (Read 6 times) previous topic - next topic

tronixstuff

If you're interested in the 74HC4067 16-Channel Analog Multiplexer Demultiplexer and how it can be controlled with the Arduino, check out our new tutorial:
http://tronixstuff.com/2013/08/05/part-review-74hc4067-16-channel-analog-multiplexerdemultiplexer/
Check out my Arduino tutorials at http://tronixstuff.com/tutorials - Order my  Arduino book from http://nostarch.com/arduino

robtillaart

Thanks for sharing,

one remark:  void setPin(int outputPin)   could be

Code: [Select]
void setPin(uint8_t outputPin)  // use smallest datatype possible
// function to select pin on 74HC4067
{
  PORTD =  controlPins[outputPin] | (PORTD & 0x0F);  // keep the state of the lower 4 pins.
}


or without controlPins array

Code: [Select]
void setPin(uint8_t outputPin)  // use smallest datatype possible
// function to select pin on 74HC4067
{
  PORTD =  (outputPin << 4) | (PORTD & 0x0F);  // keep the state of the lower 4 pins.
}

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up