Hardware Reference
In-Depth Information
void mousePressed()
{
color c = get(mouseX, mouseY); //Get the RGB color where mouse
//was pressed
String colors = int(red(c))+”,”+int(green(c))+”,”+int(blue(c))+”\n”;
//extract values from color
print(colors); //Print colors for debugging
port.write(colors); //Send values to Arduino
}
Figure 11-18: Arduino wired to XBee shield and RGB LED
Search WWH ::




Custom Search