SparkFun gator:particle Hookup Guide
Now that you have added the gator:particle extension to the Editor, lets start with some example code. Plug the micro:bit into your computer using an USB micro-B cable after you have assembled your hardware with the instructions from the previous section. The micro:bit should appear on your computer as a removable storage device.
To upload new code, this is where you will be copying the downloaded
.hex file to later.
This block should be pretty self explanatory, it sets the sensor up to be used. You should use this within the
on start block.
get _____ value
This is a value block as indicated by the block's shape. The output is an integer value from
262,143 for the sensor's detection of the specified wavelength. There is a drop down menu with selectable options for the sensor reading for the block. Below is a description of the available menu options:
red- An 18-bit integer value for sensor detection in the IR wavelength (
infrared- An 18-bit integer value for sensor detection in the IR wavelength (
- With the default LED intensity, I was only able to see a maximum of approximately 120,000. To get higher values, the LED intensity needs to be turned up.
detect heartbeat in _____
This is a value block as indicated by the block's shape. There is a drop down menu with selectable options for the output value of the block. Below is a description of the available menu options:
BPM- Outputs a single heart-rate measurement in beats per minute (BPM).
AVG- Outputs the average of the last four heart-rate readings in BPM.
This block should allows users to designate the LED modes. There are only two opions:
red- Only the red LED is used or on.
red & infrared- Both the red and IR LEDs are on.
- There is no option to use only the IR LED.
This block should allows users to control the brightness or intensity of the LEDs.
- LED- Users designate which LED to control.
- Strength- Users specify the intensity of the LED. Enter an integer.
Below, is a simple example of how to take simple measurements from the sensor. To use this example, there are multiple options for accessing the
- Replicate the block functions from the display below to copy the example project. Then download the
- Expand the display widow to pull up the example project. Then download the
- Use this link to pull up the example project. Then download the
.hexfile from the button below or the link on the bottom of the display.
The output is redirected over the serial port to avoid conflicts on pins
P1, which are also used for serial communication. To read the sensor values, pull up your favorite serial terminal emulator. Then, connect to the serial port that the micro:bit is on; the default baud rate is 115200 bps. Below, is an example of the sensor output for the example code.