Skip to content

filfreire/websockets-arduino

Repository files navigation

websockets-arduino

Experiments using arduino and websockets

List of experiments

  • Lighting a LED via websocket event
  • Reading proximity values from HCSR-04 sensor and triggering a server-sent websocket event
  • Remotely triggering a pin from a websocket event done by the client
  • Read KY-038 sound values using Sensor.Digital
  • (non-arduino related) - connecting to a Joy-Con controller and triggering the rumble

Running an experiment

Example running ledtest.js

npm i

node ledtest.js

example screenshot

Connect to ws://localhost:3000, and send:

{
    "led": "on"
}

insomnia example websocket connection

example of led on, arduino

Windows problems

  • Install Python and Visual Studio (with C++ libs)
  • Install node-gyp - npm install -g node-gyp
  • Install serialport - npm install serialport

See also