No estoy seguro de que se trata de la forma más sencilla de hacer esto lo modifiqué a la parte "Caja diamante" de la secuencia de comandos LEDCUBE.
Nota: el a continuación proviene de la importación de la biblioteca LedCube que se puede encontrar en este instructable
la secuencia de comandos es como sigue (cortar y pegar todo, después de esto en el editor de scripts de arduino)
#include
Esto es un poco algo, aviso me quedo apagado LED 0,7 y 0,6, que es porque no pude conseguir que controlarse. Están en condiciones de trabajo,
pero a pesar de mis esfuerzos no pude controlar si volvieron o desactivar. 0,7, se queda tenue y 0,6, no hace nada. (cuenta que ambos están en condiciones de trabajo)
#define tamano 3
#define COLS (tamaño * tamaño)
byte levelPins [tamaño] = {11,12,13};
byte colPins [COLS] = {2,3,4,5,6,7,8,9,10};
Cubo de LedCube (3, levelPins, colPins);
void setup)
{
Serial.Begin(9600);
}
void loop)
{
Delay(250);
cube.enableBuffer(false);
Nota: byte x [] = {capa, columna,}; se ejecutan en secuencia a partir de #0(lowest layer/first column)
un a – f dibuja la letra o
byte a [] = {0,0},
byte b [] = {0,0, 1,0,};
Byte [] c = {0,0, 1,0, 2,0,};
Byte [] d = {0,0, 1,0, 2,0, 2,1,};
Byte [] e = {0,0, 1,0, 2,0, 2,1, 2,2,};
ee de bytes [] = {0,0, 1,0, 2,0, 2,1, 2,2, 1, 2,};
Byte [] f = {0,0, 1,0, 2,0, 2,1, 2,2, 1, 2, 0,2,};
empuja la carta alrededor del cubo
Byte [] g = {0,0, 1,0, 2,0, 2,1, 2,2, 1, 2, 0,2, 0,1,};
Byte [] h = {0,1, 0,2, 1,1, 2,1, 2,2, 0,5, 1,5, 2,5,};
Byte [] = {0,2 1,2, 2,2, 0,5, 2,5, 0,8, 1, 8, 2, 8,};
Byte [] j = {1,2 1,5, 1,8, 2,2, 2,8, 2.1, 2.4, 2.7,};
Byte [] k = {2,2 2,5 2,8, 2,1, 2,7, 2.0, 2.3, 2,6,};
Byte [] l = {2.6, 2.7, 2.8, 1,3, 1,5, 1,0, 1,1, 1,2,};
Byte [] m = {2.6, 2.7, 2.8, 1,3, 1,5, 0,0, 0,1, 0,2,};
n de bytes [] = {2, 3, 2, 4, 2,5, 1,3, 1,5, 0,3, 0,4, 0,5,};
pone letra volver al principio
o de bytes [] = {2,0 2,1, 2,2, 1,2, 1,5, 0,3, 0,4, 0,5,};
Byte [] p = {0,0, 1,0, 2,0, 2,1, 2,2, 1, 2, 0,2, 0,1,};
Letra de borra
Byte [] q = {0,0, 1,0, 2,0, 2,1, 2,2, 1, 2, 0,2,};
Byte [] r = {0,0, 1,0, 2,0, 2,1, 2,2, 1, 2,};
Byte [] s = {0,0, 1,0, 2,0, 2,1, 2,2,};
Byte [] t = {0,0, 1,0, 2,0, 2,1,};
Byte [] u = {0,0, 1,0, 2,0,};
Byte [] v = {0,0, 1,0,};
Byte [] w = {0,0},
byte x [] = {};
Byte [] y = {};
Byte [] z = {};
para Bamboleo weeble
aa de bytes [] = {2,2 2,5 2,8, 2,1, 2,7, 2.0, 2.3, 2,6,};
bb de bytes [] = {2,0 2,1, 2.2, 2.3, 2.6, 1,8,};
cc de Byte [] = {2,0 2,1, 2.2, 2.5, 2.8, 1,6,};
dd de bytes [] = {2,8 2,2, 2.5, 2.6, 2.7, 1,0,};
ff de bytes [] = {2,0 2,8, 2.3, 2.6, 2.7, 1,2,};
gg de bytes [] = {};
hh de bytes [] = {2,0 2,1, 2.2, 2.3, 2.6, 1,8,};
ii de bytes [] = {2,0 2,1, 2.2, 2.5, 2.8, 1,6,};
jj de bytes [] = {2,8 2,2, 2.5, 2.6, 2.7, 1,0,};
kk de bytes [] = {2,0 2,8, 2.3, 2.6, 2.7, 1,2,};
ll de bytes [] = {};
Byte [mm] = {2,0 2,1, 2.2, 2.3, 2.6, 1,8,};
nn de bytes [] = {2,0 2,1, 2.2, 2.5, 2.8, 1,6,};
oo de bytes [] = {2,8 2,2, 2.5, 2.6, 2.7, 1,0,};
pp de bytes [] = {2,0 2,8, 2.3, 2.6, 2.7, 1,2,};
qq de bytes [] = {};
rr de bytes [] = {2,0 2,1, 2,2, 2,3, 2,7, 1, 8,};
ss de bytes [] = {2,0 2,1, 2.2, 2.5, 2.8, 1,6,};
tt de bytes [] = {2,8 2,2, 2.5, 2.6, 2.7, 1,0,};
uu de bytes [] = {2,0 2,8, 2.3, 2.6, 2.7, 1,2,};
vv de bytes [] = {2,2 2,5 2,8, 2,1, 2,7, 2.0, 2.3, 2,6,};
ww de bytes [] = {2,0 2,1, 2,2, 1,2, 1,5, 0,3, 0,4, 0,5,};
Byte [xx] = {0,0, 1,0, 2,0, 2,1, 2,2, 1, 2, 0,2, 0,1,};
yy de bytes [] = {};
zz de bytes [] = {};
helicóptero
aaa de bytes [] = {2, 4, 2, 1, 2,7,};
bbb de bytes [] = {2, 4, 2, 2, 2, 6,};
ccc de bytes [] = {2, 5, 2, 3,};
ddd de bytes [] = {2, 4, 2.8, 2.0,};
eee de bytes [] = {2, 4, 2, 1, 2,7,};
fff de bytes [] = {2, 4, 2, 2, 2, 6,};
ggg de bytes [] = {2, 5, 2, 3,};
hhh de bytes [] = {2, 4, 2.8, 2.0,};
iii de bytes [] = {2, 4, 2, 1, 2,7,};
jjj de bytes [] = {2, 4, 2, 2, 2, 6,};
kkk de bytes [] = {2, 5, 2, 3,};
lll de bytes [] = {2, 4, 2.8, 2.0,};
byte mmm [] = {2, 4, 2, 1, 2,7,};
nnn de bytes [] = {2, 4, 2, 2, 2, 6,};
ooo de bytes [] = {2, 5, 2, 3,};
ppp de bytes [] = {2, 4, 2.8, 2.0,};
qqq de bytes [] = {2, 4, 2, 1, 2,7,};
rrr de bytes [] = {2, 4, 2, 2, 2, 6,};
sss de bytes [] = {2, 5, 2, 3,};
ttt de bytes [] = {2, 4, 2.8, 2.0,};
uuu de bytes [] = {2, 4, 2, 1, 2,7,};
vvv de bytes [] = {2, 4, 2, 2, 2, 6,};
www de bytes [] = {2, 5, 2, 3,};
xxx de bytes [] = {2, 4, 2.8, 2.0,};
yyy de bytes [] = {2, 4,};
zzz de bytes [] = {2, 4,};
Nota: cube.lightSequence (* cualquier byte te refieres * sizeof (* ese byte *), * cuánto tiempo quieres estar iluminado *);
para la secuencia de la letra
cube.lightSequence (a, sizeof(a), 500);
cube.lightSequence (b, sizeof(b), 500);
cube.lightSequence (c, sizeof(c), 500);
cube.lightSequence (d, sizeof(d), 500);
cube.lightSequence (e, sizeof(e), 500);
cube.lightSequence (ee, sizeof(ee), 500);
cube.lightSequence (f, sizeof(f), 500);
cube.lightSequence (g, sizeof(g), 750);
cube.lightSequence (h, sizeof(h), 500);
cube.lightSequence (i, sizeof(i), 500);
cube.lightSequence (j, sizeof(j), 500);
cube.lightSequence (k, sizeof(k), 500);
cube.lightSequence (l, sizeof(l), 500);
cube.lightSequence (m, sizeof(m), 500);
cube.lightSequence (n, sizeof(n), 500);
cube.lightSequence (o, sizeof(o), 500);
cube.lightSequence (p, sizeof(p), 500);
cube.lightSequence (q, sizeof(q), 500);
cube.lightSequence (r, sizeof(r), 500);
cube.lightSequence (s, sizeof(s), 500);
cube.lightSequence (t, sizeof(t), 500);
cube.lightSequence (u, sizeof(u), 500);
cube.lightSequence (v, sizeof(v), 500);
cube.lightSequence (w, sizeof(w), 5000);
cube.lightSequence (x, sizeof(x), 5000);
cube.lightSequence (y, sizeof(y), 5000);
cube.lightSequence (z, sizeof(z), 200);
para la secuencia de giro excéntrico weeble
cube.lightSequence (aa, sizeof(aa), 5000);
cube.lightSequence (bb, sizeof(bb), 500);
cube.lightSequence (cc, sizeof(cc), 500);
cube.lightSequence (dd, sizeof(dd), 500);
cube.lightSequence (ff, sizeof(ff), 500);
cube.lightSequence (gg, sizeof(gg), 500);
cube.lightSequence (hh, sizeof(hh), 500);
cube.lightSequence (ii, sizeof(ii), 500);
cube.lightSequence (jj, sizeof(jj), 500);
cube.lightSequence (kk, sizeof(kk), 500);
cube.lightSequence (ll, sizeof(ll), 500);
cube.lightSequence (mm, sizeof(mm), 500);
cube.lightSequence (nn, sizeof(nn), 500);
cube.lightSequence (sizeof(oo), 500, oo)
cube.lightSequence (pp, sizeof(pp), 500);
cube.lightSequence (qq, sizeof(qq), 500);
cube.lightSequence (rr, sizeof(rr), 500);
cube.lightSequence (ss, sizeof(ss), 500);
cube.lightSequence (tt, sizeof(tt), 500);
cube.lightSequence (uu, sizeof(uu), 500);
cube.lightSequence (vv, sizeof(vv), 5000);
cube.lightSequence (ww, sizeof(ww), 750);
cube.lightSequence (xx, sizeof(xx), 1500);
cube.lightSequence (yy, sizeof(yy), 500);
para el helicóptero
cube.lightSequence (aaa, sizeof(aaa), 5000);
cube.lightSequence (bbb, sizeof(bbb), 500);
cube.lightSequence (ccc, sizeof(ccc), 500);
cube.lightSequence (ddd, sizeof(ddd), 500);
cube.lightSequence (eee, sizeof(eee), 500);
cube.lightSequence (fff, sizeof(fff), 500);
cube.lightSequence (ggg, sizeof(ggg), 500);
cube.lightSequence (hhh, sizeof(hhh), 500);
cube.lightSequence (iii, sizeof(iii), 500);
cube.lightSequence (jjj, sizeof(jjj), 500);
cube.lightSequence (kkk, sizeof(kkk), 500);
cube.lightSequence (lll, sizeof(lll), 500);
cube.lightSequence (mmm, sizeof(mmm), 500);
cube.lightSequence (nnn, sizeof(nnn), 500);
cube.lightSequence (ooo, sizeof(ooo), 500);
cube.lightSequence (ppp, sizeof(ppp), 500);
cube.lightSequence (qqq, sizeof(qqq), 500);
cube.lightSequence (rrr, sizeof(rrr), 500);
cube.lightSequence (sss, sizeof(sss), 500);
cube.lightSequence (ttt, sizeof(ttt), 500);
cube.lightSequence (uuu, sizeof(uuu), 500);
cube.lightSequence (vvv, sizeof(vvv), 500);
cube.lightSequence (www, sizeof(www), 500);
cube.lightSequence (xxx, sizeof(xxx), 500);
cube.lightSequence (yyy, sizeof(yyy), 500);
cube.lightSequence (zzz, sizeof(zzz), 500);
}