ArtNet node to drive TM1809 LED strips
Dependencies: DMX DmxArtNet EthernetNetIf mbed
Fork of ArtNode by
Diff: main.cpp
- Revision:
- 2:6d6e8afeb3b7
- Parent:
- 1:6ea5c460fdf2
diff -r 6ea5c460fdf2 -r 6d6e8afeb3b7 main.cpp --- a/main.cpp Tue Sep 24 20:41:05 2013 +0000 +++ b/main.cpp Sun Dec 29 20:03:22 2013 +0000 @@ -27,8 +27,8 @@ DigitalOut led1(LED1), led2(LED2), led3(LED3), led4(LED4); EthernetNetIf *eth; DmxArtNet art; -DMX dmx1(p13, p14); -DMX dmx2(p28, p27); +//DMX dmx1(p13, p14); +//DMX dmx2(p28, p27); Serial pc(USBTX, USBRX); SPI spi(p11, p12, p13); // mosi, miso, sclk @@ -45,7 +45,7 @@ art.Done(); } -void PutLed(long GRB) +void PutLed(unsigned long GRB) { int SpiPack = 0; int c = 0; @@ -89,19 +89,22 @@ //spi.frequency(1000000); spi.frequency(3125000); - -/* PutLed(0); - PutLed(0); - PutLed(0); - PutLed(0); - PutLed(0); - PutLed(0); - PutLed(0); - PutLed(0); - PutLed(0); - wait_us(25);*/ - -//while(1){}; +/* +unsigned long j = 0; +while(1){ + PutLed(0x000055); + PutLed(0x005500); + PutLed(0x550000); + PutLed(j+10); + PutLed(j+10); + PutLed(j+10); + PutLed(j+10); + j+=10; + wait_ms(1); + + //wait_ms(25); +}; +*/ set_new_handler(no_memory); // new handler function @@ -163,6 +166,9 @@ PutLed(PixIn); } wait_us(25); + wait_us(25); + wait_us(25); + wait_us(25); led1 = 0; } pc.printf("recv, node %d, data %x %x %x\r\n", u, art.DmxIn[u][0], art.DmxIn[u][1], art.DmxIn[u][2]);