diff options
| author | Cristian Maglie <c.maglie@bug.st> | 2013-08-23 15:59:24 +0200 |
|---|---|---|
| committer | Cristian Maglie <c.maglie@bug.st> | 2013-08-23 15:59:24 +0200 |
| commit | 540743129b2badb813b703208d121ff14553c147 (patch) | |
| tree | 6fadb4ebce68e1f0cb298a282be135c23fd156ed /libraries/TFT/examples/Arduino/TFTColorPicker | |
| parent | 073b3ac9d4ae93ac0bb3a91afc65ae9d8f1d5d59 (diff) | |
| parent | 67c84855c2f3ce99b091a756bb2ca1a016260659 (diff) | |
Merge branch 'ide-1.5.x' into dev-ide-1.5.x-discovery
Conflicts:
app/src/processing/app/Preferences.java
app/src/processing/app/debug/Uploader.java
Diffstat (limited to 'libraries/TFT/examples/Arduino/TFTColorPicker')
| -rw-r--r-- | libraries/TFT/examples/Arduino/TFTColorPicker/TFTColorPicker.ino | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/libraries/TFT/examples/Arduino/TFTColorPicker/TFTColorPicker.ino b/libraries/TFT/examples/Arduino/TFTColorPicker/TFTColorPicker.ino deleted file mode 100644 index 74fc176..0000000 --- a/libraries/TFT/examples/Arduino/TFTColorPicker/TFTColorPicker.ino +++ /dev/null @@ -1,67 +0,0 @@ -/* - - TFT Color Picker - - This example for the Arduino screen reads the input of - potentiometers or analog sensors attached to A0, A1, - and A2 and uses the values to change the screen's color. - - This example code is in the public domain. - - Created 15 April 2013 by Scott Fitzgerald - - http://arduino.cc/en/Tutorial/TFTColorPicker - - */ - -// pin definition for the Uno -#define cs 10 -#define dc 9 -#define rst 8 - -// pin definition for the Leonardo -// #define cs 7 -// #define dc 0 -// #define rst 1 - -#include <TFT.h> // Arduino LCD library -#include <SPI.h> - -TFT TFTscreen = TFT(cs, dc, rst); - -void setup() { - // begin serial communication - Serial.begin(9600); - - // initialize the display - TFTscreen.begin(); - - // set the background to white - TFTscreen.background(255, 255, 255); - -} - -void loop() { - - // read the values from your sensors and scale them to 0-255 - int redVal = map(analogRead(A0), 0, 1023, 0, 255); - int greenVal = map(analogRead(A1), 0, 1023, 0, 255); - int blueVal = map(analogRead(A2), 0, 1023, 0, 255); - - // draw the background based on the mapped values - TFTscreen.background(redVal, greenVal, blueVal); - - // send the values to the serial monitor - Serial.print("background("); - Serial.print(redVal); - Serial.print(" , "); - Serial.print(greenVal); - Serial.print(" , "); - Serial.print(blueVal); - Serial.println(")"); - - // wait for a moment - delay(33); - -} - |
