Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jun 8, 2023
1 parent ed4d520 commit c73521a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This project uses [DeviceScript](https://microsoft.github.io/devicescript/)
to interact with a [blues.io Notecard](https://blues.io/products/notecard/).

This library uses the [serial-to-i2c bridge](// https://dev.blues.io/guides-and-tutorials/notecard-guides/serial-over-i2c-protocol/).
This library uses the [serial-to-i2c bridge](https://dev.blues.io/guides-and-tutorials/notecard-guides/serial-over-i2c-protocol/).

> This library has a minimal surface and most messages have not been mapped to types. See [Notecard API](https://dev.blues.io/api-reference/notecard-api/introduction/) for a full list.
Expand All @@ -18,12 +18,6 @@ npm install --save pelikhan/devicescript-note
## Configuration

Add the notehub product UID into your settings.

```yaml
# .env.defaults
NOTE_PUID=your-product-uid
```

By default, DeviceScript will use the deviceid as a serial number; but you can override this setting.

```yaml
Expand All @@ -35,22 +29,26 @@ NOTE_SN=your-serial-number
## Usage

- Connect the notecard to your I2C pins and power it up.
- Start by calling `init` for the initial handshake with the notecard.

```ts
import { delay, millis } from "@devicescript/core"
import { init, request } from "devicescript-note"
import { init, request, NoteAddRequest } from "devicescript-note"

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

while (true) {
// send node.add request
const res = await request({ req: "note.add", body: { time: millis() } })
const res = await request(<NoteAddRequest>{
req: "note.add",
body: { time: millis() },
})
console.log(res)
// take a break
await delay(10000)
}
```

## [Contributing](./CONTRIBUTING.md)
## Contributing

Contributions are welcome. [Follow the guide](./CONTRIBUTING.md).

0 comments on commit c73521a

Please sign in to comment.