User Tools

Site Tools


projets:fuz:ac_giant_led_matrix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
projets:fuz:ac_giant_led_matrix [2019-02-22 20:22] barziprojets:fuz:ac_giant_led_matrix [2019-07-31 14:23] barzi
Line 1: Line 1:
-====== Ac giant led matrix ======+====== AC giant led matrix ======
  
 <WRAP round box 60%> <WRAP round box 60%>
Line 7: Line 7:
  
 ===== Ressources ===== ===== Ressources =====
-  * collab [[user:jeanneret|nico]] , [[user:barzi]], [[user:fabien]] +  * collab [[user:jeanneret|nico]] , [[user:barzi]], [[user:drix]], [[user:fabien]] 
-  * +  * [[https://hackaday.io/project/163657-hdmi-to-fpga-to-apa102|giant led panel with fpga]] .. interesting RS485 data transmitter for long distances (with board) 
 ===== Ressources ===== ===== Ressources =====
   * [[https://www.vishay.com/docs/83608/h11aa1.pdf|Optocoupleur/capteur 240V du secteur]]   * [[https://www.vishay.com/docs/83608/h11aa1.pdf|Optocoupleur/capteur 240V du secteur]]
   * [[https://hackspark.fr/fr/electronique/1310-relay-module-solid-state-high-level-8-channel-5v-dc-.html|solid state relayX8]] qui est zerocrossing   * [[https://hackspark.fr/fr/electronique/1310-relay-module-solid-state-high-level-8-channel-5v-dc-.html|solid state relayX8]] qui est zerocrossing
  
-===== Dev =====+===== Dev log ===== 
 + 
 +==== session 22 fev 2019 ==== 
 +{{:projets:fuz:acmatrix_leds_action.jpg?400|}} 
 +{{:projets:fuz:acmatrix_zero_crossing.jpg?400|hint: the code is not working here...(should be waiting for HIGH)}} 
 +{{:projets:fuz:acmatrix_relays.jpg?400|}} 
 +{{:projets:fuz:acmatrix_scanlines.jpg?400|}} 
 + 
 +===== Code ===== 
 + 
 +++++ Code arduino 240V lettres 2 colonnes | 
 +<code c> 
 + 
 +#include <DIO2.h> 
 +#define DEBUG false 
 + 
 +#define COL_NB 2 
 +#define LIN_NB 7 
 + 
 +int pin_col[COL_NB] = {3, 2}; 
 +int pin_lin[LIN_NB] = {4, 5, 6, 7, 8, 9, 10}; 
 + 
 +int seg[2][7] = { {0, 1, 0, 1, 0, 0, 0},{1, 0, 1, 0, 1, 0, 0} }; 
 + 
 +//AC 
 +#define  pinACsense A0 
 +int last_AC_detect = LOW; 
 + 
 +void setup() { 
 +  //AC 
 +  pinMode2(pinACsense, INPUT); 
 +  pinMode2(LED_BUILTIN, OUTPUT); 
 + 
 +  for (int i = 0; i < COL_NB; i++) { 
 +    pinMode2(pin_col[i], OUTPUT); 
 +  } 
 + 
 +  for (int i = 0; i < LIN_NB; i++) { 
 +    pinMode2(pin_lin[i], OUTPUT); 
 +  } 
 + 
 +  if (DEBUG) Serial.begin(115200); 
 +  if (DEBUG) Serial.println("let's rock!"); 
 +
 + 
 + 
 +int letter[7]; 
 + 
 +void loop() { 
 +  //int digitNb = ((long)millis / 1000) % 2; 
 + 
 +  // COLONNES < 2 
 +  for (int j = 0; j < 2; j++) { 
 + 
 +    // copy current letter 
 +    /* 
 +    for (int k = 0; k < 7; k++) { 
 +      letter[k] = seg[j][k]; 
 +      if (DEBUG) Serial.print(letter[k]); 
 +      if (DEBUG) Serial.print("\t"); 
 +    } 
 +    if (DEBUG) Serial.println(""); 
 +    */ 
 +    //////////////////// 
 + 
 +    // allume une colonne 
 +    int b = pin_col[j]; 
 +    digitalWrite2(b, HIGH); 
 + 
 + 
 +    // LIGNES < 7 
 +    for (int i = 0; i < 7; i++) { 
 + 
 +      int a = pin_lin[i]; 
 + 
 +      //if (letter[i] == 1) { 
 +      if (seg[j][i] == 1) { 
 +        digitalWrite2(a, HIGH); 
 +        if (DEBUG) Serial.print("HIGH"); 
 +      } 
 +      else { 
 +        digitalWrite2(a, LOW); 
 +        if (DEBUG) Serial.print("LOW"); 
 +      } 
 +      if (DEBUG) Serial.println(""); 
 + 
 +    } // end lines 
 + 
 + 
 +    // persistence retinienne (env 40ms) 
 +     
 +    delayMicroseconds(9000); 
 +     
 +    // Wait for AC sync... 
 +    int AC_detect = LOW; 
 +    while ( AC_detect !=  HIGH) { 
 +      AC_detect = digitalRead2(pinACsense); 
 +    } 
 + 
 + 
 +    // cols down 
 +    digitalWrite2(b, LOW); 
 +      
 +    // lines down 
 +    for (int t = 0; t < 7; t++) { 
 +      int z = pin_lin[t]; 
 +      digitalWrite2(z, LOW); 
 +    } 
 +     
 +  } // end cols 
 + 
 +
 +</code> 
 +++++
  
 ++++ Code arduino 240V led matrix test simple  ++++ Code arduino 240V led matrix test simple 
projets/fuz/ac_giant_led_matrix.txt · Last modified: 2023-02-02 22:06 by 127.0.0.1