- "CYD" ESP32 board
- ESP32 board
- LIS3DH Accelerometer
- CJMCU-2812B-12 LED strip
- Clone this repository and make sure you have Arduino installed
- Install Adafruit LIS3DH and Adafruit NeoPixel (for the sensors), TFT_eSPI and XPT2046_Touchscreen (for drawing on the display) from arduino's library manager
- In order for the TST_eSPI library to work, you need to prepare User_Setup.h config file:
-> preparing the config file for Windows PC (https://randomnerdtutorials.com/cheap-yellow-display-esp32-2432s028r/#config-file-windows-pc)
-> preparing the config file for Mac OS (https://randomnerdtutorials.com/cheap-yellow-display-esp32-2432s028r/#config-file-mac-os) - Run the readMacAddress function (found in both scipts), to get the MAC address of each ESP, then assign the opposite values to broadcastAddress variable.
| LIS3DH | ESP32 | Info |
|---|---|---|
| VCC | 3.3V | Power - you can also use 5V |
| GND | GND | Ground |
| SCL | 22 | Serial Clock |
| SDA | 21 | Serial Data |
| LIS3DH | ESP32 | Info |
|---|---|---|
| VCC | 5V | Power - always use 5V!!! |
| GND | GND | Ground |
| DO | 5 | Data Out - any digital output pin can be used |
Open the textToESP file, and run the following command:
pip install pyserialand,
SERIAL_PORT = "/dev/<PORT>" # should be the same as the one in arduino (go to Tools -> Port)
BAUD_RATE = 115200 # must match the ESP baud rateNow run the script and follow the prompt.
Run the following command,
flask --app main run --host=0.0.0.0now the server is externaly visible.
Go to esp32_script file, add the server's ip address and your wifi credentials:
String localServerName = <YOUR_SERVER_IP_ADRESS>;
const char* ssid = <YOUR_WIFI_NAME>;
const char* password = <YOUR_WIFI_PASSWORD>; //Now that everything has been configured correctly, plug in both the ESP32s into the laptop and flash the code into both of them. !!! When flashing the code on the main ESP32 board, keep pressing on the BOOT button right when the uploading starts !!!