Giter Club home page Giter Club logo

ledimote's Introduction

LediMote

Remote-controlled LEDs using Intel Edison and Node.js. iOS and Android clients are also available.

The demo uses the JavaScript MRAA API to interface with Edison's IO. See led-speech-edison for a Python example. The demo also uses Socket.IO (WebSockets) to control the LEDs remotely.

Take a look at this video to see it in action.

Supplies

Setting up Edison

If you haven't already, follow the Getting Started instructions from Intel, then return to these instructions.

Package manager configuration

Add AlexT's unofficial opkg repository. It contains many precompiled packages that can be installed by simply typing opkg install <package name>.

To configure the repository, add the following lines to /etc/opkg/base-feeds.conf:

src/gz all http://repo.opkg.net/edison/repo/all
src/gz edison http://repo.opkg.net/edison/repo/edison
src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32

Update the package manager and install the first package we need:

opkg update
opkg install git

With git installed, we can now clone this repository onto Edison.

Installing MRAA using Edison helper scripts

Note: Newer versions of the Edison firmware may already have MRAA installed, so this step may be unnecessary.

edison-scripts provides a set of scripts for simplifying some things on Edison. Although only one script is needed for this demo, it may be useful for future projects. To use it, do the following:

git clone https://github.com/drejkim/edison-scripts.git ~/edison-scripts

# Add ~/edison-scripts to PATH
echo 'export PATH=$PATH:~/edison-scripts' >> ~/.profile
source ~/.profile

Then, run the following:

# Install MRAA, the low level skeleton library for IO communication on Galileo, Edison, and other platforms
installMraa.sh

Installing Node.js packages

  • Navigate to server.
  • Install the Node.js packages by typing npm install.

The circuit

SparkFun recommends using transistors to fully (and safely) light LEDs. To learn more about using transistors as switches, see this tutorial.

Note: You can use the Edison Mini or Arduino Breakout boards. However, the pin mappings will differ. For more details, see this tutorial from SparkFun.

Wiring up the circuit

Shut down Edison and unplug it from power. Connect the LEDs to the GPIO block as shown:

Schematic

Connections

Important: The direction of the LEDs and the transistors matter! For the LEDs, the anode (longer leg) connects to a 330Ω resistor, while the cathode (shorter leg) connects to the collector of the transistor. When the flat edge of a transistor is facing you, the order of the pins from left to right are as follows: emitter, base, and collector.

Testing the circuit

To see if the LEDs are configured correctly:

  • Navigate to server.
  • Run the blink code by typing node blink.js.

The LEDs should blink on and off simultaneously.

Running the demo

Updating the WebSocket address

Modify socket in web/app.js. The section of the code looks like this:

// MODIFY THIS WITH THE APPROPRIATE URL
var socket = io.connect('http://myedison.local:8080');

Replace myedison with the name of your Edison.

Running the Node.js server

  • Navigate to server.
  • Run the server by typing node server.js.

The Node.js server should now be running. The console will look something like this:

HTTP server listening on port 8080

Using the web client

Open a browser window and navigate to http://myedison.local:8080, where myedison is the name of your Edison. You should now be able to control the LEDs from the browser! If you are unable to access the page, make sure your PC is on the same WiFi network as your Edison.

Using the iOS client

See LediMoteiOS.

Using the Android client

See LediMoteAndroid.

ledimote's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ledimote's Issues

Feature Request; Sync Button Status

First off thank you for sharing this code its what i have been looking for. as i am still very new to coding i was wondering if it would be possible to save the state of a button. for example lets say i trigger led1 on from computer a when i pull up the web page on computer b i would like to to show the current state ie on. or if i close out of the browser when i go back in to it to show the current state of the buttons. iv tired tons of searches and playing around with the code a bit but haven't been able to figure it out. Also i would like to display input variables from the arduino breakout board on the web page such as temperature from pin 11 for example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.