-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisualArduino.ino
More file actions
40 lines (28 loc) · 1.07 KB
/
VisualArduino.ino
File metadata and controls
40 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "VisualArduino.h"
#define YP A2 // must be an analog pin, use "An" notation!
#define XM A3 // must be an analog pin, use "An" notation!
#define YM 8 // can be a digital pin
#define XP 9 // can be a digital pin
// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
#define WIDTH 320
#define HEIGHT 240
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 500);
Form form= Form(&tft, &ts);
Button btnA = Button(10,10,100,20,"Button",3);
void setup() {
Serial.begin(9600);
Serial.println(F("VisualArduino"));
tft.begin(0x7575);
form.addControl(&btnA);
form.show();
}
void loop() {
}