Pages: [1]   Go Down
Author Topic: Charlieplexing LEDs  (Read 378 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My understanding of Charlieplexing is that you can hook up to 6 LEDs to 3 pins given that the pins can take three different states (High, Low and Input).  The High and Low I understand but don't you set the pin to Output or Input before the main loop of the program starts running?  How do you control the LEDs in the main loop of the program, i.e. how to you switch a pin to Input on the fly?
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 572
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nothing hard about it! Just use the PinMode command - it can be used anywhere, not just at the start of the sketch!
Logged

France
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3634
There is an Arduino for that
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure pinMode use is limited to the setup fonction ??
I can't test it (I'm currently at work) but I think you can use pinMode in loop or other function.
Logged

Pages: [1]   Go Up
Jump to: