Skip to content

espruino/BangleJS2BareMetal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bangle.js Minimal C Example Code

This is a minimal example of running your own barebones C code on Bangle.js 2, with support for Bluetooth, LCD, Button and Touchscreen.

Example code is based on nrf5x_17/examples/ble_peripheral/ble_app_uart/main.c (for BLE UART capability)

See https://www.espruino.com/Bangle.js2+Technical for full details of pinouts and hardware.

Building

# make the software
make
# write the softdevice (only need to do this once)
make flash_softdevice
# write the actual firmware
make flash

Implemented

  • Bluetooth UART
  • Button
  • Kick Watchdog timer once a second while button is pressed (long press still reboots to bootloader)
  • Charging detect
  • Backlight
  • LCD screen (simple text, fillrect)
  • Touchscreen

Not Implemented

  • Accelerometer
  • Magnetometer
  • HRM

Notes

  • We use software I2C for touch, and software SPI for the LCD screen just for simplicity (hardware would allow background updates to the screen)
  • The LCD is using 4 bit mode (3 bit mode or black and white is possible - but again, simplicity)
  • While on, the touchscreen draws ~1.5mA, and the backlight draws ~60mA

About

Bangle.js Minimal (Bare Metal) C Example Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published