Close

ESP32 test code

A project log for Haptic Sleeve

Sleeve worn on the arm to provide haptic feedback while performing handwriting exercises.

grant-stankaitisGrant Stankaitis 03/11/2020 at 18:240 Comments

After getting Zerynth set up and working properly with my ESP32, I worked with both the Zerynth example code snippets and wrote some of my own code.

Uploading code to ESP32

To upload the code to the ESP32, there is the Build menu in Zerynth in the uppermost menu bar. Once clicked, there are dropdown options for Verify and UplinkVerify will compile your code, verifying it and checking for any errors, and Uplink will perform the same verification, along with uploading the code to your ESP32.

Zerynth examples

Instructions for how to use the Zerynth examples can be found here.

Below, I have written my own bit of code to test that both the onboard ESP32 button and LED work.

When the button is depressed, the onboard LED light will turn on!

pinMode(BTN0, INPUT)
pinMode(LED0, OUTPUT) 

while(True):
    if(digitalRead(BTN0) == 0):
        digitalWrite(LED0, HIGH)
    else:
        digitalWrite(LED0, LOW)

Now that I have verified connectivity and the functionality of the ESP32, my next steps will be establishing wireless connectivity with our server.

Discussions