Skip to content

Screen text

Use the eink module to display some text on the screen.

Code

toit
import lightbug.devices as devices
import lightbug.services as services
import lightbug.messages.messages_gen as messages

// A simple application that draws a simple bit of text on the E-ink display
main:
  device := devices.I2C --background=false
  
  print "💬 Sending text to device"
  page := (random 10 255)
  device.eink.draw-element --page-id=page --status-bar-enable=false --type=messages.DrawElement.TYPE_BOX --x=0 --y=0 --text="Lightbug..."

Output

[jaguar] INFO: program 970dfee5-ec68-d8ad-ade5-06b62aaad39b started
💬 Sending text to device

Result

You should see text drawn on the screen.