element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Upcycle It
  • Challenges & Projects
  • Design Challenges
  • Upcycle It
  • More
  • Cancel
Upcycle It
Blog [Upcycle It] Interactive Race Car Driver - Edison
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Workshopshed
  • Date Created: 8 Apr 2017 7:33 PM Date Created
  • Views 752 views
  • Likes 5 likes
  • Comments 4 comments
  • interactiveracecardriver
  • upcycle_it
  • upcycled_interactiveracecardriver
  • intel_edison
  • mraa
Related
Recommended

[Upcycle It] Interactive Race Car Driver - Edison

Workshopshed
Workshopshed
8 Apr 2017

As mentioned previously my daughter helped me assemble the Edison and Arduino breakout board.

image

Installation

I followed the Getting Started with the Edison guide for Win32. The drivers download page suggested that the drivers were only for 64bit Windows but installed just fine, as did the FTDI drivers. However when I ran the setup the Intel Edison Setup application it seemed to remove those drivers and replace with some others. Once the new drivers were installed I picked the option to download and install the latest firmware.

imageimage

We named the board "Eddie", enabled SSH and connected up to the Wifi. Once the board finished and rebooted I checked I could ping

Eddie.Local

image

I also checked we could connect with SSH and login as root, using Putty. Once in I double checked the version.

 

root@Eddie:~# cat /etc/version
201606061707

 

I checked for newer software from the repositories with:

opkg update
opkg upgrade

 

It upgraded mraa and upm which connect up the hardware so that's probably a good thing.

 

Prerequisites

Node and MQTT are the main components I needed installed, I checked node using

 

node --version

 

That came back as v4.4.3, that's not the latest so looking at how to upgrade that might be a good idea.

 

I also checked mosquito was installed using

opkg info mosquito

 

Given that mosquito is installed, I'll swap to that rather than Mosca which I've been using for testing.

 

Quick test with MRAA

I mashed together a few articles to get myself a blinking LED on D7 on the grove shield

 

#!/usr/bin/env node
var mraa = require('mraa'); 
console.log('MRAA Version: ' + mraa.getVersion()); 

var led = new mraa.Gpio(7); 
led.dir(mraa.DIR_OUT); 

var ledState = true; 

setInterval(function () { 
 led.write(ledState?1:0);
 ledState = !ledState;
}, 1000);

 

Then I put together an example for using the input and an interrupt.

 

#!/usr/bin/env node
var mraa = require('mraa'); 
console.log('MRAA Version: ' + mraa.getVersion());

var button = new mraa.Gpio(5);
var led = new mraa.Gpio(7); 

var ledState = true;

button.dir(mraa.DIR_IN);
led.dir(mraa.DIR_OUT);

button.isr(mraa.EDGE_RISING, function () {
 led.write(ledState?1:0);
 ledState = !ledState;
});

setInterval(function () {} , 1000); //Do nothing, stops the apps exiting

process.on('SIGINT', function () {
    console.log("Shutting down SIGINT (Ctrl-C)");
    button.isrExit();
    led.write(0);
    process.exit();
});

 

Reference

https://davidwalsh.name/nvm

mosquito

https://wiki.openwrt.org/doc/techref/opkg

mraa: Intel Edison

https://github.com/intel-iot-devkit/mraa/tree/master/examples/javascript

https://software.intel.com/en-us/node/562029#Digital_outputs

https://gist.github.com/george-hawkins/632bad44aa47d528a0eb#file-node-js-mraa-isr-md

Exploring Edison - Mraa GPIO

 

Previous Posts

[Upcycle It] Interactive Race Car Driver - Plan of action

[Upcycle It] Interactive Race Car Driver - Software

[Upcycle It] Interactive Race Car Driver - Lights

[Upcycle It] Interactive Race Car Driver - Detailed Plan

  • Sign in to reply

Top Comments

  • Workshopshed
    Workshopshed over 8 years ago in reply to jasonwier92 +2
    The nice thing about the interrupts is that you don't have to worry about keeping your ISR quick and tiny as you would in C. The decoupling has already been done in the library.
  • mcb1
    mcb1 over 8 years ago +1
    They don't look like big steps, but they are essential steps, and in the right direction.
  • Workshopshed
    Workshopshed over 8 years ago in reply to mcb1 +1
    This step went very smoothly but was a critical unknown to eliminate. Just got PWM to review for motor speed.
  • Workshopshed
    Workshopshed over 8 years ago in reply to jasonwier92

    The nice thing about the interrupts is that you don't have to worry about keeping your ISR quick and tiny as you would in C. The decoupling has already been done in the library.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jasonwier92
    jasonwier92 over 8 years ago

    I really like the interrupt code example. Thanks for sharing, I have not thought to try that yet.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 8 years ago in reply to mcb1

    This step went very smoothly but was a critical unknown to eliminate. Just got PWM to review for motor speed.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 8 years ago

    They don't look like big steps, but they are essential steps, and in the right direction.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube