1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-12-24 11:21:24 +03:00

examples: format all .ino files

This formats all the example source files using Arduino style rules.
This commit is contained in:
Ivan Grokhotkov
2018-02-19 18:30:59 +03:00
committed by Ivan Grokhotkov
parent e226251b27
commit 61cd8d8385
88 changed files with 2730 additions and 2801 deletions

View File

@@ -14,41 +14,35 @@ unsigned int colors[8] = {BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1};
TouchScreen ts = TouchScreen(XP, YP, XM, YM); //init TouchScreen port pins
void setup()
{
Tft.TFTinit(); //init TFT library
Serial.begin(115200);
//Draw the pallet
for(int i = 0; i<8; i++)
{
Tft.fillRectangle(i*30, 0, 30, ColorPaletteHigh, colors[i]);
}
void setup() {
Tft.TFTinit(); //init TFT library
Serial.begin(115200);
//Draw the pallet
for (int i = 0; i < 8; i++) {
Tft.fillRectangle(i * 30, 0, 30, ColorPaletteHigh, colors[i]);
}
}
void loop()
{
// a point object holds x y and z coordinates.
Point p = ts.getPoint();
void loop() {
// a point object holds x y and z coordinates.
Point p = ts.getPoint();
//map the ADC value read to into pixel co-ordinates
//map the ADC value read to into pixel co-ordinates
p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
if (p.z > __PRESURE) {
// Detect paint brush color change
if(p.y < ColorPaletteHigh+2)
{
color = colors[p.x/30];
}
else
{
Tft.fillCircle(p.x,p.y,2,color);
}
if (p.z > __PRESURE) {
// Detect paint brush color change
if (p.y < ColorPaletteHigh + 2) {
color = colors[p.x / 30];
} else {
Tft.fillCircle(p.x, p.y, 2, color);
}
}
}
/*********************************************************************************************************
END FILE