Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- pinMode(PA2, OUTPUT); //A
- pinMode(PA3, OUTPUT); //B
- pinMode(PA4, OUTPUT); //C
- pinMode(PA5, OUTPUT); //D
- pinMode(PA6, OUTPUT); //E
- pinMode(PA7, OUTPUT); //F
- pinMode(PA8, OUTPUT); //H
- pinMode(PA11, OUTPUT); //J
- pinMode(PA12, OUTPUT); //K
- pinMode(PB5, OUTPUT); //G1
- pinMode(PA0, OUTPUT); //G2
- pinMode(PA1, OUTPUT); //L
- pinMode(PB7, OUTPUT); //M
- pinMode(PB8, OUTPUT); //N
- }
- void Printaletter (bool a, bool b, bool c, bool d, bool e, bool f, bool h, bool j, bool k, bool g1, bool g2, bool l, bool m, bool n){
- digitalWrite(PA2, a);
- digitalWrite(PA3, b);
- digitalWrite(PA4, c);
- digitalWrite(PA5, d);
- digitalWrite(PA6, e);
- digitalWrite(PA7, f);
- digitalWrite(PA8, h);
- digitalWrite(PA11, j);
- digitalWrite(PA12, k);
- digitalWrite(PB5, g1);
- digitalWrite(PA0, g2);
- digitalWrite(PA1, l);
- digitalWrite(PB7, m);
- digitalWrite(PB8, n);
- };
- void Printaletteradvanced(char letter) {
- if (letter == 'A') {
- Printaletter(1,1,1,0,1,1,0,0,0,1,1,0,0,0);
- }
- if (letter == 'B') {
- Printaletter(1,1,1,1,0,0,0,1,0,0,1,0,1,0);
- }
- if (letter == 'C') {
- Printaletter(1,0,0,1,1,1,0,0,0,0,0,0,0,0);
- }
- if (letter == 'D') {
- Printaletter(1,1,1,1,0,0,0,1,0,0,0,0,1,0);
- }
- if (letter == 'E') {
- Printaletter(1,0,0,1,1,1,0,0,0,1,0,0,0,0);
- }
- if (letter == 'F') {
- Printaletter(1,0,0,0,1,1,0,0,0,1,1,0,0,0);
- }
- if (letter == 'G') {
- Printaletter(1,0,1,1,1,1,0,0,0,0,1,0,0,0);
- }
- if (letter == 'H') {
- Printaletter(0,1,1,0,1,1,0,0,0,1,1,0,0,0);
- }
- if (letter == 'I') {
- Printaletter(1,0,0,1,0,0,0,1,0,0,0,0,1,0);
- }
- if (letter == 'J') {
- Printaletter(0,1,1,1,1,0,0,0,0,0,0,0,0,0);
- }
- if (letter == 'K') {
- Printaletter(0,0,0,0,1,1,0,0,1,1,0,0,0,1);
- }
- if (letter == 'L') {
- Printaletter(0,0,0,1,1,1,0,0,0,0,0,0,0,0);
- }
- if (letter == 'M') {
- Printaletter(0,1,1,0,1,1,1,0,1,0,0,0,0,0);
- }
- if (letter == 'N') {
- Printaletter(0,1,1,0,1,1,1,0,0,0,0,0,0,1);
- }
- if (letter == 'O') {
- Printaletter(1,1,1,1,1,1,0,0,0,0,0,0,0,0);
- }
- if (letter == 'P') {
- Printaletter(1,1,0,0,1,1,0,0,0,1,1,0,0,0);
- }
- if (letter == 'Q') {
- Printaletter(1,1,1,1,1,1,0,0,0,0,0,0,0,1);
- }
- if (letter == 'R') {
- Printaletter(1,1,0,0,1,1,0,0,0,1,1,0,0,1);
- }
- if (letter == 'S') {
- Printaletter(1,0,1,1,0,0,1,0,0,0,1,0,0,0);
- }
- if (letter == 'T') {
- Printaletter(1,0,0,0,0,0,0,1,0,0,0,0,1,0);
- }
- if (letter == 'U') {
- Printaletter(0,1,1,1,1,1,0,0,0,0,0,0,0,0);
- }
- if (letter == 'V') {
- Printaletter(0,0,0,0,1,1,0,0,1,0,0,1,0,0);
- }
- if (letter == 'W') {
- Printaletter(0,1,1,0,1,1,0,0,0,0,0,1,0,1);
- }
- if (letter == 'X') {
- Printaletter(0,0,0,0,0,0,1,0,1,0,0,1,0,1);
- }
- if (letter == 'Y') {
- Printaletter(0,1,0,0,0,1,0,0,0,1,1,0,1,0);
- }
- if (letter == 'Z') {
- Printaletter(1,0,0,1,0,0,0,0,1,0,0,1,0,0);
- }
- };
- void loop() {
- // Printaletter(1,1,1,1,1,1,1,1,1,1,1,1,1,1); Use this to test if all the segments are connected properly.
- // delay(1000);
- int spd = 575; // Speed. Smaller = faster.
- Printaletteradvanced('S');
- delay(spd);
- Printaletteradvanced('I');
- delay(spd);
- Printaletteradvanced('T');
- delay(spd);
- Printaletteradvanced('R');
- delay(spd);
- Printaletteradvanced('I');
- delay(spd);
- Printaletter(0,0,0,0,0,0,0,0,0,0,0,0,0,0);
- delay(4000);
- //Printaletter(1,1,1,1,1,1,1,1,1,1,1,1,1,1); // Use this fuction to test if all the segments are connected properly.
- /* for (char i = 'A'; i <= 'Z'; i++ ){ // Uncomment this to test all the characters.
- Printaletteradvanced(i);
- delay(1000);
- } */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement