Paso 5: Sketch de Arduino
/*
CREADO por GAMAGEDARA ERANGA IN SRI LANKA EMAIL: developer.eranga * / int a = 13; int b = 8; int c = 6; int d = 5; int e = 4; int f = 3; int g = 9;
int D1 = 2; int D2 = 11; int D3 = 12; int D4 = 10;
int [] def = {1,1,1,1,1,1,1};
int letra [8] = {};
int n1 [] = {0,0,1,1,1,1,1}; int n2 [] = {0,1,0,0,1,0,0}; int [n3] = {0,0,0,1,1,0,0}; int [n4] = {0,0,1,1,0,1,0}; int [n5] = {1,0,0,1,0,0,0}; int n6 [] = {1,0,0,0,0,0,0}; int [n7] = {0,0,1,1,0,0,1}; int [n8] = {0,0,0,0,0,0,0}; n9 de int [] = {0,0,0,1,0,0,0}; int [n0] = {0,0,0,0,0,0,1};
int LA [] = {0,0,1,0,0,0,0}; int LB [] = {0,0,0,0,0,0,0}; int LC [] = {1,1,0,0,0,0,1}; int LD [] = {0,0,0,0,1,1,0}; int [LE] = {1,1,0,0,0,0,0}; int LF [] = {1,1,1,0,0,0,0}; int LG [] = {0,0,0,1,0,0,0}; int LH [] = {1,0,1,0,0,0,0}; int LI [] = {1,1,1,0,0,1,1}; int [LJ] = {0,0,0,1,1,1,1}; int LK [] = {0,0,1,0,0,1,0}; int LL [] = {1,1,0,0,0,1,1}; int LM [] = {1,0,1,0,1,1,0}; int LN [] = {1,0,1,0,1,1,0}; LO de int [] = {1,0,0,0,1,1,0}; LP de int [] = {0,1,1,0,0,0,0}; int [LQ] = {0,0,1,1,0,0,0}; int LR [] = {0,0,1,0,0,0,0}; [] int LS = {1,0,0,1,0,0,0}; int LT [] = {1,1,1,0,0,0,1}; LU de int [] = {0,0,0,0,0,1,1}; int del LV [] = {0,0,0,0,0,1,1}; int LW [] = {0,0,0,0,0,1,1}; int LX [] = {1,0,1,0,0,0,0}; int [LY] = {0,0,0,1,0,1,0}; int LZ [] = {0,1,0,0,1,0,0};
void setup() {}
pinMode(a,OUTPUT); pinMode(b,OUTPUT); pinMode(c,OUTPUT); pinMode(d,OUTPUT); pinMode(e,OUTPUT); pinMode(f,OUTPUT); pinMode(g,OUTPUT);
pinMode(D1,OUTPUT); pinMode(D2,OUTPUT); pinMode(D3,OUTPUT); pinMode(D4,OUTPUT); Serial.Begin(9600); }
void loop() {}
Printer("1234567890");
} void impresora (String str) {si (str.length() < = 4) {showDigit(D1,str[0]); showDigit(D2,str[1]); showDigit(D3,str[2]); showDigit(D4,str[3]);} Else {wordShifter(str);}} void wordShifter(String str) {}
int i = 0; mientras (i
invalidar getPattern (char s) {switch (s) {caso '1': para (int j = 0; j < 7; j ++) {letra [j] = n1 [j];} break; caso '2': para (int j = 0; j < 7; j ++) {letra [j] = n2 [j];} break; caso '3': para (int j = 0; j < 7; j ++) {letra [j] = n3 [j];} break; caso de '4': para (int j = 0; j < 7; j ++) {letra [j] = n4 [j];} break; caso '5' : para (int j = 0; j < 7; j ++) {letra [j] = n5 [j];} break; '6' del caso: para (int j = 0; j < 7; j ++) {letra [j] = n6 [j];} break; '7' del caso: para (int j = 0; j < 7; j ++) {letra [j] = n7 [j];} break; '8' del caso: para (int j = 0; j < 7; j ++) {letra [j] = n8 [j];} break; '9' del caso: para (int j = 0; j < 7; j ++) {letra [j] = n9 [j];} break; caso '0': para (int j = 0; j < 7; j ++) {letra [j] = n0 [j];} break; caso 'A': para (int j = 0; j < 7; j ++) {letra [j] = LA [j];} break; caso 'B': para (int j = 0; j < 7; j ++) {letra [j] = LB [j];} break; caso 'C': de (int j = 0; j < 7; j ++) {letra [j] = LC [j];} break; caso sería ': para (int j = 0; j < 7; j ++) {letra [j] = LD [j];} break; caso 'E': para (int j = 0; j < 7; j ++) {letra [j] = LE [j];} break; 'F' del caso: para (int j = 0; j < 7; j ++) {letra [j] = LF [j];} break; 'G' del caso: para (int j = 0; j < 7; j ++) {letra [j] = LG [j];} break; 'H' del caso: para (int j = 0; j < 7; j ++) {letra [j] = LH [j];} break; caso 'I': para (int j = 0; j < 7; j ++) {letra [j] = LI [j];} break; 'J' del caso: para (int j = 0; j < 7; j ++) {letra [j] = LJ [j];} break; caso 'K': para (int j = 0; j < 7; j ++) {letra [j] = LK [j];} break; caso 'L': para (int j = 0; j < 7; j ++) {letra [j] = LL [j];} break; caso soy ': para (int j = 0; j < 7; j ++) {letra [j] = LM [j];} break; caso ' n ': para (int j = 0; j < 7; j ++) {letra [j] = LN [j];} break; caso ' o ': para (int j = 0; j < 7; j ++) {letra [j] = LO [j];} break; 'P' del caso: para (int j = 0; j < 7; j ++) {letra [j] = LP [j];} break; caso 'Q': para (int j = 0; j < 7; j ++) {letra [j] = LQ [j];} break; 'R' del caso: para (int j = 0; j < 7; j ++) {letra [j] = LR [j];} break; de caso ': para (int j = 0; j < 7; j ++) {letra [j] = LS [j];} break; caso ' t ': para (int j = 0; j < 7; j ++) {letra [j] = LT [j];} break; caso de la 'U': para (int j = 0; j < 7; j ++) {letra [j] = LU [j];} break; por defecto: para (int j = 0; j < 7; j ++) {letra [j] = def [j];} break;
} }
void showDigit2 (int lugar, char s) {getPattern(s); digitalWrite(place,1); digitalWrite(a,letter[0]); digitalWrite(b,letter[1]); digitalWrite(c,letter[2]); digitalWrite(d,letter[3]); digitalWrite(e,letter[4]); digitalWrite(f,letter[5]); digitalWrite(g,letter[6]); delay(4); digitalWrite(place,0);} void showDigit (int lugar, char s) {getPattern(s); digitalWrite(place,1); digitalWrite(a,letter[0]); digitalWrite(b,letter[1]); digitalWrite (c , letter[2]); digitalWrite(d,letter[3]); digitalWrite(e,letter[4]); digitalWrite(f,letter[5]); digitalWrite(g,letter[6]);
Delay(4); digitalWrite(place,0); }