mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Run new astyle formatter against all the examples
This commit is contained in:
@ -1,26 +1,26 @@
|
||||
/*
|
||||
|
||||
Esplora TFT Bitmap Logos
|
||||
|
||||
|
||||
This example for the Arduino TFT screen is for use
|
||||
with an Arduino Esplora.
|
||||
|
||||
|
||||
This example reads an image file from a micro-SD card
|
||||
and draws it on the screen, at random locations.
|
||||
|
||||
There is a .bmp file included with this sketch.
|
||||
|
||||
There is a .bmp file included with this sketch.
|
||||
- open the sketch folder (Ctrl-K or Cmd-K)
|
||||
- copy the "arduino.bmp" file to a micro-SD
|
||||
- put the SD into the SD slot of the Arduino LCD module.
|
||||
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
|
||||
Created 19 April 2013 by Enrico Gueli
|
||||
|
||||
|
||||
http://arduino.cc/en/Tutorial/EsploraTFTBitmapLogo
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// include the necessary libraries
|
||||
#include <Esplora.h>
|
||||
#include <SPI.h>
|
||||
@ -46,13 +46,13 @@ void setup() {
|
||||
EsploraTFT.println("Open serial monitor");
|
||||
EsploraTFT.println("to run the sketch");
|
||||
|
||||
// initialize the serial port: it will be used to
|
||||
// initialize the serial port: it will be used to
|
||||
// print some diagnostic info
|
||||
Serial.begin(9600);
|
||||
while (!Serial) {
|
||||
// wait for serial monitor to be open
|
||||
}
|
||||
|
||||
|
||||
// try to access the SD card. If that fails (e.g.
|
||||
// no card present), the Esplora's LED will turn red.
|
||||
Serial.print("Initializing SD card...");
|
||||
@ -62,10 +62,10 @@ void setup() {
|
||||
return;
|
||||
}
|
||||
Serial.println("OK!");
|
||||
|
||||
|
||||
// clear the GLCD screen before starting
|
||||
EsploraTFT.background(255, 255, 255);
|
||||
|
||||
|
||||
// now that the SD card can be access, try to load the
|
||||
// image file. The Esplora LED will turn green or red if
|
||||
// the loading went OK or not.
|
||||
@ -84,18 +84,18 @@ void loop() {
|
||||
if (logo.isValid() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Serial.println("drawing image");
|
||||
|
||||
|
||||
// get a random location where to draw the image.
|
||||
// To avoid the image to be draw outside the screen,
|
||||
// take into account the image size.
|
||||
int x = random(EsploraTFT.width() - logo.width());
|
||||
int y = random(EsploraTFT.height() - logo.height());
|
||||
|
||||
|
||||
// draw the image to the screen
|
||||
EsploraTFT.image(logo, x, y);
|
||||
|
||||
|
||||
// wait a little bit before drawing again
|
||||
delay(1500);
|
||||
}
|
||||
|
Reference in New Issue
Block a user