![]() ![]() I have an Arduino Mega 2560 and the CD4067BE. I am not sure how to use multiple buttons with this multiplexer library. Here you'll see the analog values from all eight independent I/O (Y0-Y7) read and printed out once a second.I just have a small problem with this Arduino library: CD74HC4067. The selectMuxPin function sets the S0, S1, and S2 pinsĪfter uploading the sketch, open your serial monitor and set the baud rate to 9600. Int inputValue = analogRead(zInput) // and read Z SelectMuxPin(pin) // Select one at a time PinMode(zInput, INPUT) // Set up Z as an input Serial.begin(9600) // Initialize the serial port SparkFun Multiplexer Breakout - 8-Channel(74HC4051) v10 This sketch demonstrates how to use the SparkFun Multiplexerīreakout - 8 Channel (74HC4051) to drive eight outputs using If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE.If you have not previously installed an Arduino library, please check out our installation guide. Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. "X" means it doesn't matter what the logic level of the pin is (because it will be trumped by the enable pin). ![]() EĪssuming the mux is powered at 5V, "L," for "low", is any voltage between 0 and about 2V and "H" - "high" - is any voltage between around 3 and 5V. The function table below shows how those pins work together to select the I/O. The select pins (S2-S0), in addition to the enable pin ( E), control which (if any) of the eight independent I/O pins (Y0-Y7) are connected to the common pin (Z). Selectable I/O to be routed to common pin Negative supply voltage (Jumpered to ground by default) Select inputs, S2 is the msb and S0 is the lsb The table below summarizes each pin and its function. Both sides include supply and ground connections (V CC, V EE, GND). The other side provides access to all eight independent I/O's (Y0-Y7). One half of the board breaks out the control signals ( E, S0-S2) and common input/output (Z). If the subjects below sound foreign to you, consider browsing through that tutorial before continuing on. There are a few subjects you should be familiar with before diving into multiplexing, though. Muxes are a great tool for electronics users of all experience levels - anyone who needs to multiply their project's pin count.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |