Differences

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

Link to this comparison view

projekte:dot-matrix-display [2016-07-04 20:18]
cracki [Pinbelegungen]
projekte:dot-matrix-display [2017-01-17 02:01]
Line 1: Line 1:
-====== Dot Matrix Display ====== 
  
-<WRAP right> 
-^ Dot Matrix Display  || 
-^ Inventar | [[https://inv.aachen.ccc.de/items/inventory/0c509d7d-ca7f-4bbc-852a-34c0cf791526|Gegenstand im Inventar]] | 
-^ Kontakt | [[wiki:user:cracki |cracki ]] | 
-^ Status | <fc green>aktiv</fc> (2016-06-28 09:01) | 
-</WRAP> 
- 
-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. 
- 
-  * http://digital-wizard.net/avr_projects/p10_led_display_panel_interface 
-  * http://ediy.com.my/index.php/blog/item/116-arduino-driving-a-32x16-dot-matrix-display-panel 
-  * https://github.com/freetronics/DMD 
-  * https://github.com/freetronics/DMD2 
- 
-===== Pinbelegungen ===== 
- 
-  * 1: Output Enable (PWM-fähig) 
-  * 2: A mux 
-  * 4: B mux 
-  * 8: Shift Clock (SPI clock) 
-  * 10: Store Clock (SPI select) 
-  * 12: R (SPI mosi) 
- 
-Arduino: 
-  * 1 -> D9 
-  * 2 -> D6 
-  * 4 -> D7 
-  * 8 -> D13 
-  * 10 -> D8 
-  * 12 -> D11 
- 
-ESP: 
-  * 1 -> D3 (weil D0 scheinbar kein PWM darf?) 
-  * 2 -> D1 
-  * 4 -> D2 
-  * 8 -> GPIO 14 / D5 
-  * 10 -> GPIO 15 / D8 (soll nen 4k7 pulldown kriegen, fuer startup mode selection) 
-  * 12 -> GPIO 13 / D7 
-===== 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