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
projekte:dot-matrix-display [2016-07-05 09:08] – [Pinbelegungen] crackiprojekte:dot-matrix-display [2017-01-17 01:01] (current) – external edit 127.0.0.1
Line 10: Line 10:
 Zwei Dot Matrix Panels aus China, 32x16 Pixel Rot, 10 mm Pitch (P10). Keine Ahnung, wem die gehören. Zwei Dot Matrix Panels aus China, 32x16 Pixel Rot, 10 mm Pitch (P10). Keine Ahnung, wem die gehören.
  
-Arduino, Steckbrett, Netzteil sind Clubbesitz/Getränkekasse.+Arduino, ESP8266 NodeMCU Devboard, Steckbrett, Netzteil sind Clubbesitz/Getränkekasse.
  
   * http://digital-wizard.net/avr_projects/p10_led_display_panel_interface   * http://digital-wizard.net/avr_projects/p10_led_display_panel_interface
Line 26: Line 26:
   * 12: R (SPI mosi)   * 12: R (SPI mosi)
  
-Arduino+===== Implementierung ===== 
-  * 1 -> D9 + 
-  * 2 -> D6+  * modifizierte DMD2https://github.com/crackwitz/DMD2 
 +  * arduino sketch und lua script https://github.com/crackwitz/esp8266-arduino-dmd2-pixelflut 
 +  * TCP pixelflut kommt *vielleicht* noch. wer ne implementierung in NodeMCU-Lua anschleppt 
 + 
 +==== MQTT Endpunkte ==== 
 + 
 +  * runlevel : shutdown/launch 
 +    * kontrolliert, ob gameoflife laeuft oder alles aus 
 +  * cracki/esp-devboard/ 
 +    * reset : 
 +      * "arduino" = resettet nur den Arduino 
 +      * alles andere resettet den ganzen Apparat 
 +    * solid : 0/1/255 
 +      * 0 und 1 setzen die pixel auf 0 oder 1 
 +      * 255 invertiert alles 
 +    * dutycycle : 0-255 
 +      * sollte man nicht uebertreiben, sonst sperrt das alles komplett. Die aktuelle Stromversorgung (und Verkabelung) sollte nicht weit ueber 20 getrieben werden, sonst haengt das alles. 
 +    * pixelflut : PX <x> <y> <0/1
 +    bitmap : 128 bytes 
 +    * text : Text vollhoch 
 +    * text1 : Text Zeile 1 
 +    * text2 : Text Zeile 2 
 +    * gameoflife : 0/1 
 +    * gameoflife/noise : 0-255 
 +    * gameoflife/autonoise : 0/1 
 + 
 +==== Pinbelegungen ==== 
 + 
 +Panel -> Arduino: 
 +  * 1 -> D9 (mit 100k pulldown, sonst legen die panels los, ueberlasten das netzteil, spannung am arsch, arduino kommt nicht hoch)
   * 4 -> D7   * 4 -> D7
   * 8 -> D13   * 8 -> D13
Line 34: Line 63:
   * 12 -> D11   * 12 -> D11
  
-ESP:+Arduino mit ESP fuer netzwerk: 
 +  * RXD <- ESP TXD0 
 +  * TXD <- ESP RXD0 
 +  * reset <- ESP D2 
 +  * GND und VCC passend 
 + 
 +ESP als netzwerksklave an Arduino: 
 +  * erde, vcc 
 +  * TXD0 -> Arduino RX 
 +  * RXD0 -> Arduino TX 
 +  * D2 -> arduino reset 
 + 
 +ungetestete alternative, falls man custom firmware fuer den ESP bauen will:
   * 2 (A mux) -> D1   * 2 (A mux) -> D1
   * 4 (B mux) -> D2   * 4 (B mux) -> D2
Line 42: Line 83:
   * 12 (R) -> D7 (HMOSI)   * 12 (R) -> D7 (HMOSI)
  
-===== aktuelle Arbeit daran ==== 
-  * mx hackt eine python library, wodurch Pixel [gegeben durch (x,y)] manipuliert werden kann 
-  * mx will dann pixelflut und ähnliches laufen lassen 
- 
-Example Code mit Noise, gerade genug um es am laufen zu halten: 
-<code> 
-/* 
-  Game of Life display 
- 
-  Simulates Conway's Game of Life 
-  https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life 
- */ 
- 
-#include <SPI.h> 
-#include <DMD2.h> 
- 
-// How many displays do you have? 
-const int WIDTH = 2; 
-const int HEIGHT = 1; 
- 
-SPIDMD dmd(WIDTH,HEIGHT); 
- 
-void populate_random_cells() { 
-  // Populate the initial display randomly 
-  for(int x = 0; x < dmd.width; x++) { 
-    for(int y = 0; y < dmd.height; y++) { 
-      if(random(100) < 30) // Increase 30 to a higher number to set more initial pixels 
-        dmd.setPixel(x,y,GRAPHICS_ON); 
-      dmd.setPixel(x,y,GRAPHICS_OFF); 
-    } 
-  } 
-} 
- 
-// the setup routine runs once when you press reset: 
-void setup() { 
-  Serial.begin(9600); 
-  dmd.setBrightness(50); 
-  dmd.begin(); 
- 
-  randomSeed(analogRead(0)); 
-  populate_random_cells(); 
-} 
- 
-// the loop routine runs over and over again forever: 
-void loop() { 
-  // Store the current generation by copying the current DMD frame contents 
-  DMDFrame current_generation(dmd); 
- 
-  long start = millis(); 
- 
-  // random seed 
-  for (int k = 13; k > 0; k -= 1) 
-    current_generation.setPixel(random(dmd.width), random(dmd.height), GRAPHICS_ON); 
- 
-  // Update next generation of every pixel 
-  bool change = false; 
-  for(int x = 0; x < dmd.width; x++) { 
-    for(int y = 0; y < dmd.height; y++) { 
-      bool state = current_generation.getPixel(x,y); 
-      int live_neighbours = 0; 
- 
-      // Count how many live neighbours we have in the current generation 
-      for(int nx = x - 1; nx < x + 2; nx++) { 
-        for(int ny = y - 1; ny < y + 2; ny++) { 
-          if(nx == x && ny == y) 
-            continue; 
-          if(current_generation.getPixel(nx,ny)) 
-            live_neighbours++; 
-        } 
-      } 
- 
-      // Update pixel count for the next generation 
-      if(state && (live_neighbours < 2 || live_neighbours > 3)) { 
-        state = false; 
-        change = true; 
-      } 
-      else if(!state && (live_neighbours == 3)) { 
-        state = true; 
-        change = true; 
-      } 
-      dmd.setPixel(x,y,state ? GRAPHICS_ON : GRAPHICS_OFF); 
-    } 
-  } 
- 
-  Serial.println(String("Generation time: ") + (millis() - start) + " ms"); 
  
-  if(!change && 0) { 
-    // We've made it to an unchanging state 
-    delay(500); 
-    populate_random_cells(); 
-    // (We can't detect steady states where things change forward 
-    // and back, for these you need to press reset!) 
-  } 
-} 
-</code> 
Navigation



You are not allowed to add pages