Pages: [1]   Go Down
Author Topic: 4051 as demux?  (Read 670 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi everybody, its the first time i write in this forum... smiley
 
im very much of a beginner in everything concers arduino... i hope that u got some patiance for some slow questions...
 
im trying to build a box wich has 16 buttons and 16 leds... the idea is very simple , i press a button, and a led goes on.. (revolutionery, isnt it?) it suppose to be a kind of step sequencer controller... ive mannaged to multiplex 16 inputs to the arduino and to read it in max/msp, but i have no luck doing the opposite, i mean operating the leds... i could not find any info about the 4051 as demux on the web...woud anybody have any suggstions on how to keep on going? would sombody be kind enough to post am example code, even the simple of the simplest, just to give me an idea?  
 
 
thanks very much for your time....
 
 
sbx
 
Logged

FR
Offline Offline
Full Member
***
Karma: 0
Posts: 105
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you read this http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1197745060 and this
http://www.arduino.cc/playground/Learning/4051

Nicolas
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for replying...yea, i did... unfortunatly, when i try to use the example code of the arduino 4051 tutorial, i get this error:

 In function 'void loop()':
error: 'count' was not declared in this scope


and about the other thread with the links, none of them is arduino related... (except of this excelnt little scale blog, which in this case deals with multiplexing, not with de multiplexing...)



Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you remove  all occurrences of the double slash '//'  it will compile

Leave all backslashes '\\' as they are
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks, manged to complie... but im a shame to say that i didnt got any further by communicating with the mux thrugh max... smiley but mybe my questions are too slow for this forum....i just dont really know where to start...


thanks very much for ur time!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

btw, correct me if im wrong, but the code example on the 4051 tutorial is only about multiplying inputs, aint it?
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For outputs, try

http://www.arduino.cc/en/Tutorial/ShftOut22

74hc595's x 2 is enough to control 16 LEDs from 3 DO's

Logged

Greenwood, Indiana
Offline Offline
God Member
*****
Karma: 0
Posts: 508
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Two 74HC595's  for 16 out, they daisy chain, you use them with with shift out, they latch so you can flip the latch and the arduino can do something else like run two 74HC165 for 16 *digital* in chips in a continuous loop looking for a low or high showing a button push. This needs you to learn to use pulse in which is tricky but doable.

« Last Edit: January 07, 2008, 10:58:14 pm by mrmeval » Logged

If it was designed by man it can be repaired by man.

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Better still, here's a pic of the 595's

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1185507207

At about page 3, I've added 4021's, plus an RFID reader - the inputs and outputs are derived from these tutorials:-

http://www.arduino.cc/en/Tutorial/ShiftIn

and  

http://www.arduino.cc/en/Tutorial/ShiftOut

Throw them both together, and you can have an unlimited number of inputs and outputs, plus the chips are inexpensive.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks! ive ordered the 595´s... should take them a week or so... btw, how complicated would it be to combine 2 x 595 as shift in, 2 x 595 for shift out, and 2 x 4051 for analog read? (codewise?)




« Last Edit: January 08, 2008, 07:29:07 pm by sbx » Logged

Pages: [1]   Go Up
Jump to: