projets:fuz:ac_giant_led_matrix
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projets:fuz:ac_giant_led_matrix [2019-02-22 20:22] – barzi | projets:fuz:ac_giant_led_matrix [2023-02-02 22:06] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======  | + | ======  | 
| <WRAP round box 60%> | <WRAP round box 60%> | ||
| Line 7: | Line 7: | ||
| ===== Ressources ===== | ===== Ressources ===== | ||
| - |   * collab [[user: | + |   * collab [[user: | 
| - | * | + |   * [[https:// | 
| ===== Ressources ===== | ===== Ressources ===== | ||
|   * [[https:// |   * [[https:// | ||
|   * [[https:// |   * [[https:// | ||
| - | ===== Dev ===== | + | ===== Dev log ===== | 
| + | |||
| + | ==== session 22 fev 2019 ==== | ||
| + | {{: | ||
| + | {{: | ||
| + | {{: | ||
| + | {{: | ||
| + | |||
| + | ===== Code ===== | ||
| + | |||
| + | ++++ Code arduino 240V lettres 2 colonnes | | ||
| + | <code c> | ||
| + | |||
| + | #include < | ||
| + | #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 | ||
| + | # | ||
| + | int last_AC_detect = LOW; | ||
| + | |||
| + | void setup() { | ||
| + | //AC | ||
| + |   pinMode2(pinACsense, | ||
| + |   pinMode2(LED_BUILTIN, | ||
| + | |||
| + | for (int i = 0; i < COL_NB; i++) { | ||
| + |     pinMode2(pin_col[i], | ||
| + | } | ||
| + | |||
| + | for (int i = 0; i < LIN_NB; i++) { | ||
| + |     pinMode2(pin_lin[i], | ||
| + | } | ||
| + | |||
| + |   if (DEBUG) Serial.begin(115200); | ||
| + |   if (DEBUG) Serial.println(" | ||
| + | } | ||
| + | |||
| + | |||
| + | 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(" | ||
| + | } | ||
| + |     if (DEBUG) Serial.println("" | ||
| + | */ | ||
| + |     //////////////////// | ||
| + | |||
| + | // allume une colonne | ||
| + |     int b = pin_col[j]; | ||
| + |     digitalWrite2(b, | ||
| + | |||
| + | |||
| + | // 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, | ||
| + |         if (DEBUG) Serial.print(" | ||
| + | } | ||
| + | else { | ||
| + |         digitalWrite2(a, | ||
| + |         if (DEBUG) Serial.print(" | ||
| + | } | ||
| + |       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, | ||
| + | |||
| + | // lines down | ||
| + | for (int t = 0; t < 7; t++) { | ||
| + |       int z = pin_lin[t]; | ||
| + |       digitalWrite2(z, | ||
| + | } | ||
| + | |||
| + | } // end cols | ||
| + | |||
| + | } | ||
| + | </ | ||
| + | ++++ | ||
| ++++ Code arduino 240V led matrix test simple  | ++++ Code arduino 240V led matrix test simple  | ||
projets/fuz/ac_giant_led_matrix.1550866949.txt.gz · Last modified:  (external edit)