Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:
Unfortunately, Windows users need to manually install a driver to allow UART to USB comms. Go to this pagehttps://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads

  1. Donwload the Windows Universal Driver

  2. Unzip the file

  3. Right click on the unzipped file called “silabser.inf”, and click install

  4. Follow the prompts

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:

Code Block
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules

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 above ner lp commands are simply shortcuts. Feel free to try other platformio 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.

...