These colors will be used as ROM indicators as we build our Homotronics robots.
Arduino R3 UNO board
iHackLab RGB Colors
powered by Arduino
sketched by J.B. Wylzan
modified by Lawsinium
The RGB LED will display the colors red, green and blue continuously.
This example code is public domain.
int redPin = 8;
int greenPin = 7;
int bluePin = 4;
digitalWrite(redPin, HIGH); // red led
digitalWrite(redPin, LOW); // green led
digitalWrite(redPin, LOW); // blue led
Sketch a program that will produce other colors aside from red, green and blue by altering or combining HIGH or LOW inside digitalWrite(). Be surprised what colors will be created. Use the programming procedure technique below to create various colors by replacing r, g, and b with any numbers from 0 to 255. Happy painting ;-).
void displayRGB(int r, int g, int b)
1. Build the prototype as shown above
2. Run the Arduino Interface
3. Select File > New
4. Copy Code # 21 above
5. Paste Code #21
6. Click File > Save
7. Click Verify
8. Click Upload
9. The RGB led will change colors from Red, Green and Blue.
Disclaimer: We shall not be liable for any loss or damage of whatever nature - direct, indirect, consequential, or otherwise - which may arise as a result of your use of any information on this website. However, if you are interested in using any of the projects for personal or educational purposes, please inform the author by email.
Public Domain Notice: Copyright (c) 2000. All rights reserved. This article is part of a book entitled iHackRobot. Copies are welcome to be shared or distributed publicly as long proper citations are observed. Please cite as follows: A Journal of a Creative Mind, Joey Lawsin, 1988, USA.
Patent Pending. 2000 © ®