../ 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
  • remote: Send keyboard events to a sketch running on a different device.

playgrounds

  • keys: Show key events

gamepad

  • button: track the state of a key

midi

  • button: work with a MIDI note as a button

espruino

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

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