...
Hopefully you’ve done the full setup described throughout this doc. If you have, the launchpad subsystem is embedded into your venv already! To confirm you are all ready, in your terminal (with the venv active), simply run
Code Block |
---|
launchpadner lp install |
You should be greeted with a bunch of installs- and this sets up the ESP32 specific tooling. In order for these changes to be recognized, you should deactivate and then reactivate the ner-venv. Also note, you may see some things “error”, but the install continues. This is generally okay, so feel free to ignore.
Info |
---|
Only if on Windows/WSL:
Then follow the WSL passthrough instructions here. Select “Silicon Labs” as your device when connected to the ESP32. |
Info | ||
---|---|---|
Only if on Linux (not WSL): Linux needs to give permissions to access the USB device. run this command:
Unplug the device, and plug it back in, and you should be all set. You may need to do a computer reboot. |
2. Clone the github classroom repo.
...
https://classroom.github.com/a/_1lecy_U
...
Once your code is ready to build, and assuming you’ve run “launchpad install” in the venv, you can do so with the following command:
Code Block |
---|
lpbuildner lp build |
To upload the built code to the board, run
Code Block |
---|
lpflashner lp flash |
To view logs
Code Block |
---|
platformioner devicelp monitorserial |
To view the Bluetooth data, download the NRF connect app on your phone. In the scanner, you should see an ESP device. Connect to that and you should be able to see the message!
...
The hall sensor normally would need to be calibrated to account for the ambient magnetic field in your environment. Doing so is out of scope of this task, so don’t worry about it too much, just try to set it up so that the light does not blink much at the reading level it gets without the magnet nearby. Depending on your environment, this might be at different reading values. All apps have the same ADC resolution, but you may read stronger or weaker fields, which is okay. Regardless, the strength should increase as the magnet gets closer. To test this, you may want to simply guess and check - you should incorporate some sort of “offset” ADC value, where the LED doesnt/barely blinks if the reading is as low as you record when no magnet is nearby. Also, it doesn't need to be extremely precise. Maybe you only have 2 or 3 blink speeds for strength ranges - this doesn't need to be a continuous and fine grained speed increase for every tiny change in field strength
When Using multiple threads like in an RTOS application, data atomicity is important. If a piece of data is accessed from multiple threads, it is important to use a locking mechanism, like a mutex or semaphore, to make sure that sharing this data is done safely
Explore your tools: We use the dependency command
platformio
. The abovener lp
commands are simply shortcuts. Feel free to try otherplatformio
commands to further test, debug, or learn more about what you are building.
Again, please ask questions! Bay times and meetings will dedicate time for launchpad discussions, if you are new to embedded, this stuff may seem really confusing and we are here to help make it less daunting.
...