Paso 3: Programe el ATtiny MCU
Después siguió a la guía de arriba, conecte el ATtiny y subir el sketch.
Para cambiar el mensaje, abra el bosquejo y desplácese hasta la parte inferior. Habrá una línea que dice "displayString("wow!!");", se puede cambiar el texto dentro de comillas Si desea cambiar el mensaje. Después de haber hecho esto, sólo volver a subir el boceto para el ATtiny y usted está listo para ir.
Aquí está el código (por alguna razón no me permite subir el fichero .pde, siguen diciendo HTTP Error o ir se queda al 100%. Si alguien sabe cómo solucionar esto, por favor Dile.):
int delayTime = 2; char el tiempo de retardo int LED1 = 0; void setup() int a [] = {1, 6, 26, 6, 1}; eos de int [] = {0, 1, 0, 0, 0}; void displayLine(int line) void displayChar(char c)
int charBreak = 5; tiempo de retardo de Char
int LED2 = 1;
int LED3 = 2;
int LED4 = 3;
int LED5 = 4;
{
pinMode (LED1, salida);
pinMode (LED2, salida);
pinMode (LED3, salida);
pinMode (LED4, salida);
pinMode (LED5, salida);
pinMode (7, entrada);
}
int b [] = {31, 21, 21, 10, 0};
int c2 [] = {14, 17, 17, 10, 0};
int d [] = {31, 17, 17, 14, 0};
int [e] = {31, 21, 21, 17, 0};
int f [] = {31, 20, 20, 16, 0};
int [] g = {14, 17, 19, 10, 0};
int [] h = {31, 4, 4, 4, 31};
int i [] = {0, 17, 31, 17, 0};
int j [] = {0, 17, 30, 16, 0};
int [k] = {31, 4, 10, 17, 0};
int l [] = {31, 1, 1, 1, 0};
int m [] = {31, 12, 3, 12, 31};
int n [] = {31, 12, 3, 31, 0};
int [] o = {14, 17, 17, 14, 0};
int p [] = {31, 20, 20, 8, 0};
int [] q = {14, 17, 19, 14, 2};
int r [] = {31, 20, 22, 9, 0};
int s [] = {8, 21, 21, 2, 0};
int [] t = {16, 16, 31, 16, 16};
int [] u = {30, 1, 1, 30, 0};
int v [] = {24, 6, 1, 6, 24};
int [] w = {28, 3, 12, 3, 28};
int x[] = {17, 10, 4, 10, 17};
int y [] = {17, 10, 4, 8, 16};
int z [] = {19, 21, 21, 25, 0};
int [excl] = {0, 29, 0, 0, 0};
ques de int [] = {8, 19, 20, 8, 0};
{
myline int;
myline = línea;
Si (myline > = 16) {digitalWrite (LED 1, elevado); myline-= 16;} else {digitalWrite (LED 1, LOW);}
Si (myline > = 8) {digitalWrite (LED2, alto); myline-= 8;} Else {digitalWrite (LED2, LOW);}
Si (myline > = 4) {digitalWrite (LED 3, alto); myline-= 4;} Else {digitalWrite (LED 3, LOW);}
Si (myline > = 2) {digitalWrite (LED4, alto); myline-= 2;} Else {digitalWrite (LED4, LOW);}
Si (myline > = 1) {digitalWrite (LED5, alto); myline-= 1;} Else {digitalWrite (LED5, LOW);}
}
{
Si (c == 'a') {para (int i = 0; i < 5; i++){displayLine(a[i]);delay(delayTime);} displayLine(0);}
Si (c == 'b') {para (int i = 0; i < 5; i++){displayLine(b[i]);delay(delayTime);} displayLine(0);}
Si (c == 'c') {para (int i = 0; i < 5; i++){displayLine(c2[i]);delay(delayTime);} displayLine(0);}
Si (c == había ') {para (int i = 0; i < 5; i++){displayLine(d[i]);delay(delayTime);} displayLine(0);}
Si (c == 'e') {para (int i = 0; i < 5; i++){displayLine(e[i]);delay(delayTime);} displayLine(0);}
Si (c == 'f') {para (int i = 0; i < 5; i++){displayLine(f[i]);delay(delayTime);} displayLine(0);}
Si (c == 'g') {para (int i = 0; i < 5; i++){displayLine(g[i]);delay(delayTime);} displayLine(0);}
Si (c == 'h') {para (int i = 0; i < 5; i++){displayLine(h[i]);delay(delayTime);} displayLine(0);}
Si (c == 'i') {para (int se = 0; se < 5; it++){displayLine(i[it]);delay(delayTime);} displayLine(0);}
Si (c == 'j') {para (int i = 0; i < 5; i++){displayLine(j[i]);delay(delayTime);} displayLine(0);}
Si (c == 'k') {para (int i = 0; i < 5; i++){displayLine(k[i]);delay(delayTime);} displayLine(0);}
Si (c == 'l') {para (int i = 0; i < 5; i++){displayLine(l[i]);delay(delayTime);} displayLine(0);}
Si (c == estoy ') {para (int i = 0; i < 5; i++){displayLine(m[i]);delay(delayTime);} displayLine(0);}
Si (c == ' n ') {para (int i = 0; i < 5; i++){displayLine(n[i]);delay(delayTime);} displayLine(0);}
Si (c == 'o') {para (int i = 0; i < 5; i++){displayLine(o[i]);delay(delayTime);} displayLine(0);}
Si (c == 'p') {para (int i = 0; i < 5; i++){displayLine(p[i]);delay(delayTime);} displayLine(0);}
Si (c == 'q') {para (int i = 0; i < 5; i++){displayLine(q[i]);delay(delayTime);} displayLine(0);}
Si (c == 'r') {para (int i = 0; i < 5; i++){displayLine(r[i]);delay(delayTime);} displayLine(0);}
Si (c == de ') {para (int i = 0; i < 5; i++){displayLine(s[i]);delay(delayTime);} displayLine(0);}
Si (c == ' t ') {para (int i = 0; i < 5; i++){displayLine(t[i]);delay(delayTime);} displayLine(0);}
Si (c == 'u') {para (int i = 0; i < 5; i++){displayLine(u[i]);delay(delayTime);} displayLine(0);}
Si (c == 'v') {para (int i = 0; i < 5; i++){displayLine(v[i]);delay(delayTime);} displayLine(0);}
Si (c == 'w') {para (int i = 0; i < 5; i++){displayLine(w[i]);delay(delayTime);} displayLine(0);}
Si (c == 'x') {para (int i = 0; i < 5; i++){displayLine(x[i]);delay(delayTime);} displayLine(0);}
Si (c == 'y') {para (int i = 0; i < 5; i++){displayLine(y[i]);delay(delayTime);} displayLine(0);}
Si (c == 'z') {para (int i = 0; i < 5; i++){displayLine(z[i]);delay(delayTime);} displayLine(0);}
Si (c == '. ') {para (int i = 0; i < 5; i++){displayLine(excl[i]);delay(delayTime);} displayLine(0);}
Si (c == '?') {para (int i = 0; i < 5; i++){displayLine(ques[i]);delay(delayTime);} displayLine(0);}
Si (c == '.') {para (int i = 0; i < 5; i++){displayLine(eos[i]);delay(delayTime);} displayLine(0);}
Delay(charBreak);
}
void displayString (char * s)
{
para (int i = 0; i < = strlen(s); i ++)
{
displayChar(s[i]);
}
}
void loop()
{
displayString("wow!!");
}