Skip to main content

Blues.io Notecard

The Blues.io Notecard provides a simple way to add cellular connectivity to your IoT project.

The pelikhan/devicescript-note package uses I2C to communicate with the Notecard.

Getting started

  • Create a new DeviceScript project
  • Add the library to your DeviceScript project:
npm install --save pelikhan/devicescript-note

Configuration

  • Add device settings to your project
  • Add the notehub product UID into your settings. By default, DeviceScript will use the deviceid as a serial number; but you can override this setting.
# .env.defaults
NOTE_PUID=your-product-uid
NOTE_SN=your-serial-number
  • Connect the notecard to your I2C pins and power it up.
import { Temperature } from "@devicescript/core"
import { delay, millis } from "@devicescript/core"
import { init, request, NoteAddRequest } from "devicescript-note"

// configure product UID and serial number
await init()

// connect sensors
const temperature = new Temperature()

while (true) {
// read sensor values
const t = await temperature.reading.read()

// send node.add request
await request(<NoteAddRequest>{
req: "note.add",
body: { t },
})

// take a break
await delay(10000)
}