Both sides previous revision Previous revision | Next revision Both sides next revision | ||
fabricademy2017:students:julie.taris:class12-skin-electronics [2018/06/30 15:31] julie_taris |
fabricademy2017:students:julie.taris:class12-skin-electronics [2018/06/30 15:38] julie_taris |
||
---|---|---|---|
Line 79: | Line 79: | ||
#include "LedControl.h" | #include "LedControl.h" | ||
- | //Declaramos los pines: DIN, CLK, CS y el nº de displays conectados en serie | + | //We declare the pins: DIN, CLK, CS and the number of displays connected in series. |
LedControl lc=LedControl(12,10,11,1); | LedControl lc=LedControl(12,10,11,1); | ||
- | //Pausa entre frames | + | //Pause between frames |
unsigned long delayTime=900; | unsigned long delayTime=900; | ||
- | //Codigo de los 2 frames que vamos a mostrar: | + | //Code of the 2 frames that we are going to show: |
- | //Corazón pequeño | + | //little heart |
byte Heart1[] = { | byte Heart1[] = { | ||
B00000000, | B00000000, | ||
Line 97: | Line 97: | ||
B00000000}; | B00000000}; | ||
- | //Corazón grande | + | //big heart |
byte Heart2[] = { | byte Heart2[] = { | ||
B01100110, | B01100110, | ||
Line 108: | Line 108: | ||
B00011000}; | B00011000}; | ||
- | //Sub para transformar array #1 en un patron para la matriz | + | //Sub to transform array #1 into a pattern for the array |
void Heart1GO() | void Heart1GO() | ||
{ | { | ||
Line 118: | Line 118: | ||
} | } | ||
- | //Sub para transformar array #2 en un patron para la matriz | + | //Sub to transform array #2 into a pattern for the array |
void Heart2GO() | void Heart2GO() | ||
{ | { | ||
Line 128: | Line 128: | ||
} | } | ||
- | //Esta sub se ejecutará 1 sola vez al arrancar el Arduino | + | //This sub will only be run once when the Arduino is started. |
void setup() { | void setup() { | ||
lc.shutdown(0,false); //Iniciamos la matriz led #1 | lc.shutdown(0,false); //Iniciamos la matriz led #1 | ||
Line 138: | Line 138: | ||
} | } | ||
- | //Esta sub se ejecutara en bucle una y otra vez mientras el Arduino este alimentado. | + | //This sub will loop over and over again while the Arduino is powered. |
void loop() { | void loop() { | ||
Heart1GO(); //Mostramos el patrón #1 | Heart1GO(); //Mostramos el patrón #1 | ||
Line 150: | Line 150: | ||
{{vimeo>254995576?medium}} | {{vimeo>254995576?medium}} | ||
- | + | As we have seen in the previous examples, each digit or character is composed of a binary code that defines the status of each LED in the array. To generate these codes quickly and easily, you can use a small Windows application based on an online tool: | |
+ | https://www.riyas.org/2013/12/online-led-matrix-font-generator-with.html | ||