Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last 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:48]
julie_taris
Line 72: Line 72:
  
 {{:​fabricademy2017:​students:​julie.taris:​capture-ecran-biblio-led.jpg?​200|}} {{:​fabricademy2017:​students:​julie.taris:​capture-ecran-biblio-led.jpg?​200|}}
-{{:​fabricademy2017:​students:​julie.taris:​capture-ecran-deadheart.jpg?​200|}} 
  
 <​code>​ <​code>​
Line 79: Line 78:
 #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 96:
 B00000000}; B00000000};
    
-//Corazón grande+</code> 
 + 
 +big heart 
 +<​code>​ 
 +//big heart
 byte Heart2[] = { byte Heart2[] = {
 B01100110, B01100110,
Line 107: Line 110:
 B00111100, B00111100,
 B00011000}; B00011000};
-  +</code> 
-//Sub para transformar ​array #1 en un patron para la matriz+Sub to transform ​array #1 into a pattern for the array 
 +<​code>​
 void Heart1GO() void Heart1GO()
 { {
Line 117: Line 121:
   }   }
 } }
-  +</code> 
-//Sub para transformar ​array #2 en un patron para la matriz+Sub to transform ​array #2 into a pattern for the array 
 +<​code> ​
 void Heart2GO() void Heart2GO()
 { {
Line 127: Line 132:
   }   }
 } }
-  +</code> 
-//Esta sub se ejecutará 1 sola vez al arrancar el Arduino+This sub will only be run once when the Arduino ​is started. 
 +<​code> ​
 void setup() { void setup() {
-lc.shutdown(0,​false); ​   //Iniciamos la matriz led #1 +lc.shutdown(0,​false); ​   //We started the LED matrix ​#1 
-lc.shutdown(1,​false); ​ //Iniciamos la matriz led #2 +lc.shutdown(1,​false); ​ //We started the LED matrix ​#2 
-lc.setIntensity(0,​5); ​   //Intensidad de los led en la matriz ​#1 +lc.setIntensity(0,​5); ​   //Intensity of the LEDs in the matrix ​#1 
-lc.setIntensity(1,​5); ​ //Intensidad de los led en la matriz ​#2 +lc.setIntensity(1,​5); ​ //Intensity of the leds in the matrix ​#2 
-lc.clearDisplay(0); ​     //Apagamos todos los led de la matriz ​#1 +lc.clearDisplay(0); ​     //We turn off all the LEDs in matrix ​#1 
-lc.clearDisplay(1); ​   //Apagamos todos los led de la matriz ​#2+lc.clearDisplay(1); ​   //We turn off all the LEDs in matrix ​#2
 } }
-  +</code> 
-//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. 
 +<​code> ​
 void loop() { void loop() {
-Heart1GO(); ​        //Mostramos el patrón ​#1 +Heart1GO(); ​        //We show the pattern ​#1 
-delay(delayTime); ​  //Pequeña pausa +delay(delayTime); ​  //little pause 
-Heart2GO(); ​        //Mostramos el patrón ​#2 +Heart2GO(); ​        //We show the pattern ​#1 
-delay(delayTime); ​  //Pequeña pausa+delay(delayTime); ​  //little pause
 } }
  
Line 150: Line 157:
 {{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
  
- +{{:​fabricademy2017:​students:​julie.taris:​capture-ecran-deadheart.jpg?​200|}}