/raspberry-pi-led-breakout

💡 Control Raspberry Pi LED breakout's with Node JS

Primary LanguageJavaScriptMIT LicenseMIT

Raspberry Pi LED Breakout

💡 Control Raspberry Pi LED breakout's with Node JS

You will need

Note: This guide was wrote for a Raspberry Pi 3 A+. Raspberry Pi Zero W and older versions will have issues installing the latest version of node and using visual studio code remotely.

Get started

Set up the Raspberry Pi

  1. Download raspbian lite
  2. Install the operating system by flashing the microSD card with the .img file. You can use etcher.
  3. If you have ethernet cable, keyboard and monitor, plug them into your raspberry pi and skip to step 5. If you do not you can set up the raspberry pi headless.
  4. SSH into the raspberry PI ssh pi@raspberrypi.local (password: raspberry)
  5. Run sudo raspi-config to finish setting up your Raspberry Pi
  6. Choose 5 Interfacing Options select P5 I2C and enable ARM I2C interface

Instal Node JS

  1. Update and upgrade the installed packages sudo apt-get update && sudo apt-get upgrade
  2. Install NVM to your Raspberry Pi curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/main/install.sh | bash
  3. Restart sudo reboot
  4. Reconnect with SSH ssh pi@raspberrypi.local
  5. Check NVM is installed and working nvm --version
  6. Install Node JS and NPM nvm install node.
  7. Test that node and NPM work node --version && npm --version

Set up Visual Studio Code to edit files remotely

  1. Install the Remote SSH extension
  2. Click the remote explorer icon in the side bar and input pi@raspberrypi.local
  3. Click the folder icon next to raspberrypi.local
  4. Enter the password in raspberry

Control LED's with Javascript

  1. Install i2c-tools sudo apt-get install i2c-tools
  2. Get the address on the LED Module by running i2cdetect -y 1 and compare the found addresses with the numbers on the LED Hardware. For example it should be 0x75 or 0x77.
  3. Install this package npm install raspberry-pi-led-breakout

Release history

  • v0.0.0 -