Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projekte:dot-matrix-display [2016-07-04 13:24] – [Pinbelegungen] cracki | projekte: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/ | + | Arduino, ESP8266 NodeMCU Devboard, Steckbrett, Netzteil sind Clubbesitz/ |
| * http:// | * http:// | ||
| Line 26: | Line 26: | ||
| * 12: R (SPI mosi) | * 12: R (SPI mosi) | ||
| - | Arduino: | + | ===== Implementierung ===== |
| - | * 1 -> D9 | + | |
| - | * 2 -> D6 | + | |
| - | * 4 -> D7 | + | |
| - | * 8 -> D13 | + | |
| - | * 10 -> D8 | + | |
| - | * 12 -> D11 | + | |
| - | ESP: | + | * modifizierte DMD2: https:// |
| - | * 1 -> D3 (weil D0 scheinbar kein PWM darf?) | + | * arduino sketch und lua script https:// |
| - | * 2 -> D1 | + | * TCP pixelflut kommt *vielleicht* noch. wer ne implementierung in NodeMCU-Lua anschleppt |
| - | * 4 -> D2 | + | |
| - | * 8 -> GPIO 14 / D5 | + | |
| - | | + | |
| - | | + | |
| - | ===== 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: | + | ==== MQTT Endpunkte ==== |
| - | < | + | |
| - | /* | + | |
| - | Game of Life display | + | |
| - | | + | |
| - | | + | * kontrolliert, |
| - | */ | + | |
| + | * reset : | ||
| + | * " | ||
| + | * 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, | ||
| + | * pixelflut : PX <x> <y> <0/1> | ||
| + | * bitmap : 128 bytes | ||
| + | * text : Text vollhoch | ||
| + | * text1 : Text Zeile 1 | ||
| + | * text2 : Text Zeile 2 | ||
| + | * gameoflife : 0/1 | ||
| + | * gameoflife/ | ||
| + | * gameoflife/ | ||
| - | #include < | + | ==== Pinbelegungen ==== |
| - | #include < | + | |
| - | // How many displays do you have? | + | Panel -> Arduino: |
| - | 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, | + | |
| - | } | + | |
| - | | + | |
| - | } | + | |
| - | + | ||
| - | // the setup routine runs once when you press reset: | + | |
| - | void setup() { | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | 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), | + | |
| - | // Update next generation of every pixel | + | Arduino mit ESP fuer netzwerk: |
| - | | + | |
| - | | + | |
| - | | + | * reset <- ESP D2 |
| - | bool state = current_generation.getPixel(x, | + | * GND und VCC passend |
| - | int live_neighbours = 0; | + | |
| - | // Count how many live neighbours we have in the current generation | + | ESP als netzwerksklave an Arduino: |
| - | | + | * erde, vcc |
| - | | + | * TXD0 -> Arduino RX |
| - | if(nx == x && ny == y) | + | * RXD0 -> Arduino TX |
| - | continue; | + | * D2 -> arduino reset |
| - | if(current_generation.getPixel(nx, | + | |
| - | live_neighbours++; | + | |
| - | } | + | |
| - | } | + | |
| - | // Update pixel count for the next generation | + | ungetestete alternative, |
| - | if(state && | + | * 2 (A mux) -> D1 |
| - | state = false; | + | * 4 (B mux) -> D2 |
| - | change = true; | + | * 1 (OE) -> D3 (sollte PWM koennen) |
| - | } | + | * 8 (SPI clock) -> D5 (HSCLK) |
| - | else if(!state && | + | * 10 (store pulse) -> D0 (gpio) |
| - | state = true; | + | |
| - | | + | |
| - | } | + | |
| - | dmd.setPixel(x,y,state ? GRAPHICS_ON : GRAPHICS_OFF); | + | |
| - | } | + | |
| - | | + | |
| - | Serial.println(String(" | ||
| - | 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!) | ||
| - | } | ||
| - | } | ||
| - | </ | ||