This is an Open Source Hardware project. Schematics and board design files are available in the /hardware directory of the repo.
The badge uses the same core module as the Puck.js and can run most of the same software.
Hardware Features include:
You write to or read from a pin with:
digitalWrite(pin, value); digitalRead(pin);
where pin is one of D0, D1, D2, D3, D4, D5, D6, D7, D8 (D0 at top) and value is 0 or 1.
The firmware has some extra API calls and variables for some of the badge features. You can use them as follows:
You can use
digitalWrite(button, value); digitalRead(button);
where value is 1 or 0 and button is one of BTNA, BTNB, BTNU, BTND, BTNL, BTNR
If you add LEDs to the corner holes, you can turn them on/off with
where led is one of LED1, LED2, LED3, LED4, LED5, LED6.
In many Espruino examples on the main site, you’ll find setup code for different types of screens. That has already been taken care of for you on the badge and you can just access the graphics functions directly. e.g.
g.clear(); g.drawString("Hello World",0,0); g.flip();
You can read the capacitance (and hence touch) from the 6 corners using
where corner is one of CORNER1, CORNER2, CORNER3, CORNER4, CORNER5, CORNER6.
You can get an estimate of the battery level by calling
It returns an approximate battery percentage remaining based on a normal CR2032 battery (2.8 - 2.2v).
You can set the screen contrast with
where c is a float from 0 to 1
You can set the URL that the NFC antenna broadcasts to NFC-capable phones by calling
where URL is something like https://www.nearform.com
NOTE: If your phone is having difficulty picking up the NFC URL, it is likely that the tuning capacitors on your badge need to be changed to different values. Head on over to the Hacking Lounge to get them replaced or be shown how to do it yourself.
If you need to flash new firmware to the badge, you must first put it in DFU mode by holding BTNA as you insert the battery and quickly letting go of BTNA. Download the Distribution Packet Zip file containing the new firmware to your phobe and use nRF Toolbox on either Android or iOS to send it to the badge.