../ input output

The input/output module contains functions for getting data in and out of the browser. All these sketches expect some additional hardware and steps. Please browse the source files and look at the associated README files.

API Reference

See also: pointers: touch, trackpad, mouse & stylus

keyboard

  • key: track the state of a key
  • keys: track the state of more than one key
  • typer: add individual letters to the screen with key events
  • cursor: move an element around with the cursor keys

playgrounds

  • keys: Show key events

gamepad

  • button: track the state of a key

midi

  • button: work with a MIDI note as a button

espruino

  • button: respond to button press (Puck.js)
  • led: Control the three on-board LEDs (Puck.js)
  • led-pwm-env: Fade an LED in and out using an envelope
  • accel-gyro: use acceleration and gyroscope sensor readings (Puck.js)
  • temperature: use temperature sensor readings (Puck.js)
  • analog input: Read one or more analog inputs (Espruino Pico)
  • drv2605: haptic motor controller (Espruino Pico).

playgrounds

arduino

These demos use Web Serial, sending JSON back and forth to an Arduino sketch.

  • switch: read data from a switch (or any other digital input)
  • joystick: read data from a joystick module
  • led-pwm: control a LED

etc