diff options
author | Cristian Maglie <c.maglie@bug.st> | 2013-08-08 16:43:19 +0200 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2013-08-08 16:43:19 +0200 |
commit | a8193ed933d9c9954cefbfb541cde56770ab5b74 (patch) | |
tree | 80796833fecca5d7426f1d09f7ac9870bab5f062 /libraries/TFT/examples/Arduino/TFTDisplayText | |
parent | a4c9fee673342304a5b12f7f2f7f9ecb9cb26d30 (diff) | |
parent | 5527c44aa443b20d63cf7a276180a36695233924 (diff) |
Merge branch 'ide-1.5.x-library-to-new-format' into ide-1.5.x
Diffstat (limited to 'libraries/TFT/examples/Arduino/TFTDisplayText')
-rw-r--r-- | libraries/TFT/examples/Arduino/TFTDisplayText/TFTDisplayText.ino | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/libraries/TFT/examples/Arduino/TFTDisplayText/TFTDisplayText.ino b/libraries/TFT/examples/Arduino/TFTDisplayText/TFTDisplayText.ino deleted file mode 100644 index f482bd1..0000000 --- a/libraries/TFT/examples/Arduino/TFTDisplayText/TFTDisplayText.ino +++ /dev/null @@ -1,74 +0,0 @@ -/* - Arduino TFT text example - - This example demonstrates how to draw text on the - TFT with an Arduino. The Arduino reads the value - of an analog sensor attached to pin A0, and writes - the value to the LCD screen, updating every - quarter second. - - This example code is in the public domain - - Created 15 April 2013 by Scott Fitzgerald - - http://arduino.cc/en/Tutorial/TFTDisplayText - - */ - -#include <TFT.h> // Arduino LCD library -#include <SPI.h> - -// 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 - -// create an instance of the library -TFT TFTscreen = TFT(cs, dc, rst); - -// char array to print to the screen -char sensorPrintout[4]; - -void setup() { - - // Put this line at the beginning of every sketch that uses the GLCD: - TFTscreen.begin(); - - // clear the screen with a black background - TFTscreen.background(0, 0, 0); - - // write the static text to the screen - // set the font color to white - TFTscreen.stroke(255,255,255); - // set the font size - TFTscreen.setTextSize(2); - // write the text to the top left corner of the screen - TFTscreen.text("Sensor Value :\n ",0,0); - // ste the font size very large for the loop - TFTscreen.setTextSize(5); -} - -void loop() { - - // Read the value of the sensor on A0 - String sensorVal = String(analogRead(A0)); - - // convert the reading to a char array - sensorVal.toCharArray(sensorPrintout, 4); - - // set the font color - TFTscreen.stroke(255,255,255); - // print the sensor value - TFTscreen.text(sensorPrintout, 0, 20); - // wait for a moment - delay(250); - // erase the text you just wrote - TFTscreen.stroke(0,0,0); - TFTscreen.text(sensorPrintout, 0, 20); -} - |