/* RGBB test code 0.8 Stuart + Aaron 07-12-10 late night looners */ // include the library code: #include #include "Tlc5940.h" // initialize the library with the numbers of the interface pins //LiquidCrystal lcd(19, 6, 5, 4, 7, 8); LiquidCrystal lcd(19, 18, 5, 4, 7, 8); int redPot = A0; int greenPot = A1; int bluePot = A2; int RedVal = 0; int GreenVal = 0; int BlueVal = 0; void setup() { //stuff for TLC LED chip Tlc.init(); // set up the LCD's number of columns and rows: lcd.begin(16, 2); } void loop(){ //read value from pots RedVal = map(analogRead(redPot),0,1010,0,100); GreenVal = map(analogRead(greenPot),0,1010,0,100); BlueVal = map(analogRead(bluePot),0,1010,0,100); // Turn on the display: // lcd.display(); // Print a test message to the LCD. lcd.clear(); lcd.setCursor(0,0); lcd.print("Red"); lcd.setCursor(5,0); lcd.print("Green"); lcd.setCursor(11,0); lcd.print("Blue"); lcd.setCursor(0,1); lcd.print(RedVal); lcd.setCursor(5,1); lcd.print(GreenVal); lcd.setCursor(11,1); lcd.print(BlueVal); delay(75); // lcd.clear(); //TLC channels Tlc.set(1,RedVal); Tlc.set(2,GreenVal); Tlc.set(3,BlueVal); Tlc.set(4,map(RedVal,0,100,0,2500)); Tlc.set(5,map(GreenVal,0,100,0,2075)); Tlc.set(6,map(BlueVal,0,100,0,950)); Tlc.update(); }