RGB-LED-Matrix: Unterschied zwischen den Versionen

aus Metalab Wiki, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Zur Navigation springenZur Suche springen
(updated instructions)
(// added pic)
 
(3 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 2: Zeile 2:
  
 
das Metalab besitzt nun eine assemblierte '''RGB-LED-Matrix'''.<br />
 
das Metalab besitzt nun eine assemblierte '''RGB-LED-Matrix'''.<br />
die Firmware die drauf ist sollte mal ins git *husti*
+
die Firmware die drauf ist, findet sich unter https://github.com/Metalab/RGBmatrix (Teensy)
  
 +
[[Datei:rgb_led_matrix.jpg|thumb|left]]
  
 
Was tuts:
 
Was tuts:
 
* Matrix an ein PC Netzteil anstecken
 
* Matrix an ein PC Netzteil anstecken
 
* USB Kabel an Datenverarbeitungsanlage anstecken
 
* USB Kabel an Datenverarbeitungsanlage anstecken
* "FNORD"  == start of frame
+
* <strike>"FNORD"  == start of frame</strike> 0x1 (siehe [[Blinkenschild]])
 
* 24*24*3 Byte Daten
 
* 24*24*3 Byte Daten
 
* win.
 
* win.
Zeile 14: Zeile 15:
  
 
in der Praxis schaut das so aus:
 
in der Praxis schaut das so aus:
 
TODO: Baudrate sollte in der Firmware noch hochgedreht werden auf 115200
 
  
 
   # set baudrate on tty
 
   # set baudrate on tty
 
   sudo stty -F /dev/ttyACM0 9600
 
   sudo stty -F /dev/ttyACM0 9600
  
 +
TODO: Baudrate sollte in der Firmware noch hochgedreht werden auf 115200
 +
 +
'''Shell:'''
 
   # send new frame
 
   # send new frame
 
   echo "FNORD" > /dev/ttyACM0
 
   echo "FNORD" > /dev/ttyACM0
Zeile 26: Zeile 28:
 
   head  -c $((24*24*3)) /dev/urandom > /dev/ttyACM0
 
   head  -c $((24*24*3)) /dev/urandom > /dev/ttyACM0
  
 +
'''Java:'''<br/>
 +
Why would you do that? For the glory of Satan of course!<br/>
 +
Get it at https://github.com/sixtyeight/fnord-matrix<br/>
 +
 +
<nowiki>
 +
package at.metalab.fun.ledmatrix;
 +
 +
import java.util.Random;
 +
 +
public class RandomPixels extends AbstractExample {
 +
private final static Random RANDOM = new Random(System.currentTimeMillis());
 +
 +
public static void main(String[] args) throws Exception {
 +
new RandomPixels().execute(args);
 +
}
 +
 +
@Override
 +
protected void init(String[] args) throws Exception {
 +
openLedMatrix("127.0.0.1", 1337); // connect to the daemon
 +
}
 +
 +
@Override
 +
protected void loop() throws Exception {
 +
Pixel pixel;
 +
for (int x = 0; x < 24; x++) {
 +
for (int y = 0; y < 24; y++) {
 +
pixel = frame[x][y];
 +
pixel.r = RANDOM.nextInt(256);
 +
pixel.g = RANDOM.nextInt(256);
 +
pixel.b = RANDOM.nextInt(256);
 +
}
 +
}
 +
 +
display(); // display the frame
 +
quit(); // exit gracefully
 +
}
 +
}
 +
</nowiki>
  
 
viel Spass damit.
 
viel Spass damit.
  
 
ich glaub [[User:Amir|Amir]] und [[User:m68k|m68k]] basteln da grade aktiv dran ;)
 
ich glaub [[User:Amir|Amir]] und [[User:m68k|m68k]] basteln da grade aktiv dran ;)
 
  
 
<nowiki>:*</nowiki>
 
<nowiki>:*</nowiki>

Aktuelle Version vom 27. April 2014, 20:22 Uhr

hi.

das Metalab besitzt nun eine assemblierte RGB-LED-Matrix.
die Firmware die drauf ist, findet sich unter https://github.com/Metalab/RGBmatrix (Teensy)

Rgb led matrix.jpg

Was tuts:

  • Matrix an ein PC Netzteil anstecken
  • USB Kabel an Datenverarbeitungsanlage anstecken
  • "FNORD" == start of frame 0x1 (siehe Blinkenschild)
  • 24*24*3 Byte Daten
  • win.


in der Praxis schaut das so aus:

 # set baudrate on tty
 sudo stty -F /dev/ttyACM0 9600

TODO: Baudrate sollte in der Firmware noch hochgedreht werden auf 115200

Shell:

 # send new frame
 echo "FNORD" > /dev/ttyACM0
 # send framedata
 head  -c $((24*24*3)) /dev/urandom > /dev/ttyACM0

Java:
Why would you do that? For the glory of Satan of course!
Get it at https://github.com/sixtyeight/fnord-matrix

package at.metalab.fun.ledmatrix;

import java.util.Random;

public class RandomPixels extends AbstractExample {
	private final static Random RANDOM = new Random(System.currentTimeMillis());

	public static void main(String[] args) throws Exception {
		new RandomPixels().execute(args);
	}

	@Override
	protected void init(String[] args) throws Exception {
		openLedMatrix("127.0.0.1", 1337); // connect to the daemon
	}

	@Override
	protected void loop() throws Exception {
		Pixel pixel;
		for (int x = 0; x < 24; x++) {
			for (int y = 0; y < 24; y++) {
				pixel = frame[x][y];
				pixel.r = RANDOM.nextInt(256);
				pixel.g = RANDOM.nextInt(256);
				pixel.b = RANDOM.nextInt(256);
			}
		}

		display(); // display the frame
		quit(); // exit gracefully
	}
}

viel Spass damit.

ich glaub Amir und m68k basteln da grade aktiv dran ;)

:* -flo [Mon, 14 Jan 2013]