if universe == 0, set start pixel to 0
if universe == 1, set start pixel to 170
if universe == 2, set start pixel to 340
set colors
display colors
and virtualdavid did u ever get this to work????????
if u did that would be soooo good!!!!!
I'm using the pixelcontroller software at the moment, as I am after some nice ambient graphics at a good refresh rate.wich software do you use to send the data over wifi?
not sure about html, but if you are sending info via art-net, the universe number is within the code, theres a little table here:Sorry for all these questions!! But I am wondering now is there anyway to change what universe the teensy is looking out for via HTML instead of doing it with usb?
//-------read incoming universe number-------------//
short incoming_universe=bytes_to_short(buff[15],buff[14])
Serial.print("universe number = ");
Serial.println(incoming_universe);
just trying to clean it up, but it is heavily embedded within the UDP CC3000 code.Nice, could you post a code example ?
Thanks !
not sure about html, but if you are sending info via art-net, the universe number is within the code, theres a little table here:
http://en.wikipedia.org/wiki/Art-Net
With Art-Net, when you gather the sent data into the receiving buffer, you can grab the universe number and check it, and then do something. As an example, you can grab the universe number by accessing array values 14 and 15:
Code://-------read incoming universe number-------------// short incoming_universe=bytes_to_short(buff[15],buff[14]) Serial.print("universe number = "); Serial.println(incoming_universe);
The idea might then be:
int in = incoming_universe;
int offset = in*universe_size;
leds.setPixel(i+offset, etc…);
i am just trying to put a small example code together for teensy to look at this value and then use this value to determine which leds to sent the info to.
Nice, could you post a code example ?
Thanks !
void grabInput(){
//-------------put the incoming data into a buffer----------//
//here, I am using a buffer called buff to receive via CC3000 UDP packet
sockLen = sizeof(sockaddr_in);
recvfrom(sockfd, buff, sizeof(buff), 0, (sockaddr*)&from, &sockLen);
//there is an equivalent read into buffer using the ethernet lib
//-------read incoming universe number-------------//
incoming_universe=bytes_to_short(buff[15],buff[14])
Serial.print("universe number = ");
Serial.println(incoming_universe);
int in = incoming_universe;
int offset = (in-1)*(universeSize);
//-------remove the header info from the data-----//
for(int h=start_address;h< number_of_channels;h++) {
buff2[h-start_address]= byte(buff[h+art_net_header_size+1]); }
//-------and send to leds with the correct offset for each universe-----//
for (byte i = 0; i < (universeSize*3); i++) {
leds.setPixel(i+offset, buff2[(i)*3], buff2[(i*3)+1], buff2[(i*3)+2]);
}
leds.show();
}
//-------read incoming universe number-------------//
incoming_universe=bytes_to_short(buff[15],buff[14])
Serial.print("universe number = ");
Serial.print(incoming_universe);
byte sequence = buff[12];
Serial.print(" ");
Serial.print("sequence n0. = ");
Serial.println(sequence);
Started AP/SSID scan
Connecting to ross...Waiting to connect...Connected to WiFi network!
Requesting address from DHCP server...OK
IP Addr: 192.168.1.10
Netmask: 255.255.255.0
Gateway: 192.168.1.255
DHCPsrv: 0.0.0.0
DNSserv: 192.168.1.255
Connect to 192.168.1.10:6454
connected to UDP port 6454
universe number = 16 sequence n0. = 15
universe number = 1 sequence n0. = 16
universe number = 2 sequence n0. = 17
universe number = 3 sequence n0. = 18
universe number = 5 sequence n0. = 20
universe number = 6 sequence n0. = 21
universe number = 8 sequence n0. = 23
universe number = 10 sequence n0. = 25
universe number = 12 sequence n0. = 27
universe number = 14 sequence n0. = 29
universe number = 16 sequence n0. = 31
universe number = 1 sequence n0. = 32
universe number = 2 sequence n0. = 33
universe number = 3 sequence n0. = 34
universe number = 4 sequence n0. = 35
universe number = 6 sequence n0. = 37
universe number = 8 sequence n0. = 39
universe number = 10 sequence n0. = 41
universe number = 12 sequence n0. = 43
universe number = 14 sequence n0. = 45
universe number = 16 sequence n0. = 47
universe number = 1 sequence n0. = 48
universe number = 2 sequence n0. = 49
universe number = 3 sequence n0. = 50