Creating a simple program Jay-D
Creating a simple program
Preparation
The PlatformIO project structure consists of the following:
- platformio.ini (Project Configuration File)
- src directory where you should place source code (*.h, *.c, *.cpp, *.S, *.ino, etc.)
- lib directory can be used for the project-specific (private) libraries
Now, you need to download the necessary libraries and configuration files from our GitHub repository and place them in your project directory.
Writing a simple program
We're now going to write a simple program. Here's a quick example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#include <Arduino.h> #include <JayD.h> Display* display; Sprite* sprite; void setup() { JayD.begin(); display = &JayD.getDisplay(); sprite = display->getBaseSprite(); pinMode(PIN_BL, OUTPUT); digitalWrite(PIN_BL, LOW); sprite->clear(TFT_BLACK); sprite->setTextColor(TFT_WHITE); sprite->setTextFont(2); sprite->setCursor(0,0); sprite->print("Hello World!"); display->commit(); } void loop() { delay(1000); } |
Next steps
Turn on your Jay-D and plug it into your computer with a USB cable.
Click the Upload button on the bottom left part of the screen (arrow pointing to the right).
You have now uploaded your code on the Jay-D!