LEDs

If you add LEDs to the corner holes, you can turn them on/off with a generic call

digitalWrite(led, value);

where led is one of LED1, LED2, LED3, LED4, LED5, LED6.

or with an LED-specific call

LEDx.write(value);

where LEDx is one of LED1, LED2, LED3, LED4, LED5, LED6 and value is 0 or 1.

Graphics

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();

Capacitive Sense

You can read the capacitance (and hence touch) from the 6 corners using

Badge.capSense(corner);

where corner is one of CORNER1, CORNER2, CORNER3, CORNER4, CORNER5, CORNER6. See note here about issue of using sense and LEDs together.

Battery Percentage

You can get an estimate of the battery level by calling

Badge.getBatteryPercentage();

It returns an approximate battery percentage remaining based on a normal CR2032 battery (2.8 - 2.2v).

Set Screen Contrast

You can set the screen contrast with

Badge.setContrast(c)

where c is a float from 0 to 1

NFC

You can set the URL that the NFC antenna broadcasts to NFC-capable phones by calling

Advanced Only: Flashing updated firmware

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 phone and use nRF Toolbox on either Android or iOS to send it to the badge.

Please only do this if you are sure you need it. By using a stock badge build from the Espruino site, you’ll lose the built-in NodeConf EU main.js code and will just have a REPL over Bluetooth on your badge.