SDK Examples
Blues provides a variety of host- and language-specific code samples to help you
get started using our SDKs, specifically note-arduino
and note-python
.
Arduino Examples
The following examples are included in the note-arduino SDK.
- Example 0: Libraryless Communication
- Learn how to communicate with a Notecard in Arduino without using the note-arduino library.
- Example 1: Notecard Basics
- Learn the basics of communicating with a Notecard, including running a
hub.set
andnote.add
request.
- Learn the basics of communicating with a Notecard, including running a
- Example 2: Periodic Communications
- Learn how to communicate with a Notecard in periodic mode, gathering sensor measurements "offline", and performing uploads on a periodic basis.
- Example 3: Inbound Polling
- Learn how to use the Notecard to poll for inbound messages at a defined interval.
- Example 4: Inbound Interrupts
- Learn how to use the Notecard to manage an inbound queue of messages using interrupts.
- Example 5: Using Templates
- Learn how to use Note templates to send outbound Notes that use minimal bandwidth.
- Example 6: Sensor Tutorial
- Learn how to collect sensor data and send it to the cloud using the Notecard. This code is also used by the sensor tutorial.
- Example 7: Power Control
- Learn how the Notecard can be used to put a host to sleep, save some state for the host, wake it up periodically and return saved state to the host.
- Example 8: Send/Receive Binary Data
- Learn how to both send and receive large binary data objects with the Notecard.
- Example 9: Send/Receive Binary Data (Chunked)
- Learn how to send and receive large binary data objects that are split into smaller "chunks" for more efficient processing.
This example is separate from the note-arduino SDK.
- Adding Multiple Data Elements in Notecard Note
- If you need to route multiple JSON data elements at once, the current best
practice is to accumulate the data elements in a JSON array that is added to
the Note
body
field.
- If you need to route multiple JSON data elements at once, the current best
practice is to accumulate the data elements in a JSON array that is added to
the Note
Python Examples
The following examples are compatible with the note-python SDK.
- Notecard Basics
- Examples for connecting to a Notecard over I2C, using a Raspberry Pi, using CircuitPython, and more.
- Reading and Syncing Sensor Data with the Notecard
- Use Python on a Raspberry Pi, or CircuitPython, to read from a BME680 sensor and sync those values with the cloud.
- Writing Binary Data to the Notecard
- This example writes an array of bytes to the binary data store on a Notecard and reads them back.
- Python Notecard DFU
- This sample shows how to use the Notecard to update a Python application running on a Raspberry Pi.
- Python Large File Upload
- This sample shows how to use the Notecard to upload a large file using the
card.binary
API and the Notecard Web request API.
- This sample shows how to use the Notecard to upload a large file using the
- Python Raspberry Pi ATTN Pin
- Example Raspberry Pi application in Python that enables users to send "commands" to Raspberry Pi from Notehub. Uses the ATTN Pin on Notecard to notify the Raspberry Pi a message is available to be read.