Removed serial output from arduino firmware.

This commit is contained in:
Uwe Lippmann 2015-03-09 22:14:06 +01:00
parent 52622d9245
commit 7514fdc004

View file

@ -20,14 +20,14 @@
Adafruit_NeoPixel strip = Adafruit_NeoPixel(WIDTH * HEIGHT, PIN, NEO_GRB + NEO_KHZ800); Adafruit_NeoPixel strip = Adafruit_NeoPixel(WIDTH * HEIGHT, PIN, NEO_GRB + NEO_KHZ800);
// Network configuration // Network configuration
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; byte mac[] = {0xFE, 0xED, 0x0D, 0xA0, 0x1E, 0xD5};
IPAddress ip(172, 22, 239, 182); IPAddress ip(172, 22, 239, 182);
unsigned int localPort = 8888; unsigned int localPort = 8888;
// buffers for receiving and sending data // buffers for receiving and sending data
char packetBuffer[UDP_PACKET_MAX_SIZE]; // buffer to hold incoming packet char packetBuffer[UDP_PACKET_MAX_SIZE]; // buffer to hold incoming packet
// Create EthernetUdp instance to send and receive packets over UDP // Create EthernetUDP instance to send and receive packets over UDP
EthernetUDP Udp; EthernetUDP Udp;
void setup() { void setup() {
@ -41,8 +41,6 @@ void setup() {
strip.setPixelColor(i, strip.Color(0, 0, 0)); strip.setPixelColor(i, strip.Color(0, 0, 0));
} }
strip.show(); strip.show();
Serial.begin(115200);
Serial.println("Ready.");
} }
void loop() { void loop() {
@ -52,20 +50,10 @@ void loop() {
if (packetSize) { if (packetSize) {
// read the packet into packet buffer // read the packet into packet buffer
Udp.read(packetBuffer, UDP_PACKET_MAX_SIZE); Udp.read(packetBuffer, UDP_PACKET_MAX_SIZE);
Serial.println("Received packet:");
Serial.print("Length: ");
Serial.println(packetSize);
// assume an incoming uncompressed BMP image
// assume we know the pixels start at offset 54
for (int i = 0; i < packetSize; i = i + 3) { for (int i = 0; i < packetSize; i = i + 3) {
Serial.print(packetBuffer[i], HEX); strip.setPixelColor(i / 3, packetBuffer[i+2], packetBuffer[i+1], packetBuffer[i]);
Serial.print(packetBuffer[i+1], HEX);
Serial.print(packetBuffer[i+2], HEX);
Serial.print(" ");
strip.setPixelColor(i / 3, packetBuffer[i], packetBuffer[i+1], packetBuffer[i+2]);
} }
Serial.print("\n");
strip.show(); strip.show();
} }
} }