Created
November 11, 2020 19:12
-
-
Save gsampallo/977ed561d17cac16173fba0699ffd972 to your computer and use it in GitHub Desktop.
Demostración de Charlieplexing con 3 pines y 6 leds.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Ejemplo de Charlieplexing con 3 pines y 6 leds. | |
* Guillermo Sampallo - 2020 | |
*/ | |
void setup() { | |
} | |
void loop() { | |
pinMode(2,OUTPUT); | |
pinMode(3,OUTPUT); | |
pinMode(4,INPUT); | |
digitalWrite(2,LOW); | |
digitalWrite(3,HIGH); | |
delay(300); | |
digitalWrite(2,HIGH); | |
digitalWrite(3,LOW); | |
delay(300); | |
pinMode(2,INPUT); | |
pinMode(3,OUTPUT); | |
pinMode(4,OUTPUT); | |
digitalWrite(3,LOW); | |
digitalWrite(4,HIGH); | |
delay(300); | |
digitalWrite(3,HIGH); | |
digitalWrite(4,LOW); | |
delay(300); | |
pinMode(2,OUTPUT); | |
pinMode(3,INPUT); | |
pinMode(4,OUTPUT); | |
digitalWrite(2,LOW); | |
digitalWrite(4,HIGH); | |
delay(300); | |
digitalWrite(2,HIGH); | |
digitalWrite(4,LOW); | |
delay(300); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment