Versions Compared

Key

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

...

Note

When testing with the magnet, do not let the metal magnet touch the board. It is a big piece of metal, and can short components together. It doesn't need to be too close to work!

...

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
lpbuild

Your code may not compile due to user errors, but there is one error that you may encounter that wouldn’t be the fault of your code. Check the bottom of the Tips section below to see this

To upload the built code to the board, run

...

  • 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

  • Id suggest getting the Bluetooth working first. That way, you can monitor the adc value in real time on your phone as you try to get the blinking mechanism working

  • (POSSIBLE BUILD ERROR THAT ISN’T YOUR FAULT)
    When building, if you get this error:

    Code Block
    platformio run --target menuconfig

...

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.

...