Skip to content

The gator:particle is an I2C based particle sensor with red and infrared channels. It is even capable of detecting a human heartbeat.

License

Notifications You must be signed in to change notification settings

sparkfun/pxt-gator-particle

Repository files navigation

gator:particle Light Sensor

Community Discord

The gator:particle, which includes the MAX30102 particle sensor can be purchased here. The gator:particle contains a MAX30102 particle sensor, which is mainly used for measuring heartrate.

SparkFun gator:particle

~ hint

To use this package, go to https://makecode.microbit.org, click Add package and search for gator-particle. The package is located here

~

Basic usage

//Initializes the gator:particle so we can use it
gatorParticle.begin()

Use ||Initialize gator:particle sensor|| to start the gator:particle up so we can read from it.

//Reads a value from the Red or Infrared LED
gatorParticle.color(LEDToRead.Red)

Use ||Red value|| to get the value from the red channel. Grabbing the infrared channel is as easy as using the dropdown to call ||Infrared value||

//Reads the heartbeat of a finger pressed to the sensor in BPM or as a running average of 4 BPM readings.
gatorParticle.heartbeat(heartbeatType.BPM)

Use ||heartbeat in BPM|| to get the heartbeat of finger on the sensor in BPM. Grabbing the average BPM is as easy as using the dropdown to call ||heartbeat in AVG||

Example: Red Detector

//Read red value and write it to the micro:bit screen as a bar graph.
gatorParticle.begin()
basic.forever(function () {
    led.plotBarGraph(
    gatorParticle.color(LEDToRead.red),
    65000
    )
})

Supported targets

  • for PXT/microbit

License

MIT

gatorParticle=github:sparkfun/pxt-gator-particle

About

The gator:particle is an I2C based particle sensor with red and infrared channels. It is even capable of detecting a human heartbeat.

Resources

License

Stars

Watchers

Forks

Packages