Posts with «node.js» label

The Most Immersive Pinball Machine: Project Supernova

Over at [Truthlabs], a 30 year old pinball machine was diagnosed with a major flaw in its game design: It could only entertain one person at a time. [Dan] and his colleagues set out to change this, transforming the ol’ pinball legend “Firepower” into a spectacular, immersive gaming experience worthy of the 21st century.

A major limitation they wanted to overcome was screen size. A projector mounted to the ceiling should turn the entire wall behind the machine into a massive 15-foot playfield for anyone in the room to enjoy.

 

With so much space to fill, the team assembled a visual concept tailored to blend seamlessly with the original storyline of the arcade classic, studying the machine’s artwork and digging deep into the sci-fi archives. They then translated their ideas into 3D graphics utilizing Cinema4D and WebGL along with the usual designer’s toolbox. Lasers and explosions were added, ready to be triggered by game interactions on the machine.

To hook the augmentation into the pinball machine’s own game progress, they elaborated an elegant solution, incorporating OpenCV and OCR, to read all five of the machine’s 7 segment displays from a single webcam. An Arduino inside the machine taps into the numerous mechanical switches and indicator lamps, keeping a Node.js server updated about pressed buttons, hits, the “Lange Change” and plunged balls.

The result is the impressive demonstration of both passion and skill you can see in the video below. We really like the custom shader effects. How could we ever play pinball without them?

 


Filed under: classic hacks, video hacks

Combining Musical Hatred with Target Practice

Not everyone can agree on what good music is, but in some cases you’ll find that just about everyone can agree on what is awful. That’s what the people over at Neo-Pangea discovered when they were listening to Internet radio. When one of those terrible songs hits their collective eardrums, the group’s rage increases and they just need to skip the track.

This is how Engineers act if the song is super-awful

Rather than use a web app or simple push button to do the trick, they turned the “skip” button into a NERF target. They call their creation the Boom Box Blaster and made a fantastic demo film video about it which is found after the break.

Inspired by a painting in the office, the target takes the form of a small hot air balloon. The target obviously needed some kind of sensor that can detect when it is hit by a NERF dart. The group tried several different sensor types, but eventually settled on a medium vibration sensor. This sensor is connected to an Arduino, which then communicates with a Raspberry Pi over a Serial connection. The Pi uses a Python script to monitor the Arduino’s vibration sensor. The system also includes some orange LEDs to simulate flames and a servo attached to the string which suspends the balloon from the ceiling. Whenever a hit is registered, the flames light up and the balloon raises into the air to indicate that the shot was on target.

The Pi was required in order to interface with the group’s streaming music service of choice; Sonos. The Sonos API made it easy for the team to interface their target with the “skip track” function. They just wrote a Node.js script that runs on the Pi and sends the proper command as necessary. Now whenever the radio asks the group if they want to build a snowman, they can all answer with a resounding, “no!”. They just need to make sure they have enough ammo to spare. Be sure to check out the comical demonstration video on the project page.


Filed under: Android Hacks, musical hacks

Play with the Basketball Robot running on Intel Edison

After you had an introduction to Intel Edison  following the Getting Started guide, and our previous tutorial, the Intel Edison mini-breakout Getting Started Guide, it’s now time to work on something a bit more complex. You’ll be also able to play a bit with Node.js,  a programming platform that runs on javascript and a good choice for building a web-based application. It is supported by the Intel® Edison standard system image so you can run node.js scripts directly on it.

He shoots! He scores! The crowd goes wild! Let’s build a robot that plays basketball with you. This tutorial is a step-by-step guide for a simple and small differential-drive robot that uses the Intel Edison. You’ll get to know a few more tricks on how to use Mini Breakout Kit and set up a node.js server for the communication.

Go and follow the steps to build it

Node.js on the Arduino Yún

Tom Igoe some days ago wrote an interesting post about Arduino Yún on his blog.  We post it here as it could be useful to the Arduino Community.

————————–

Recently, Federico Fissore added node.js to the package repository for the Arduino Yún. Here’s how you get node to communicate with the Arduino processor on the Yún via the Bridge library.

To do this, you’ll need an Arduino Yún, a microSD card, a microUSB cable and a wifi connection. You should be familiar with the basics of the Arduino Yún and node.js in order to get the most out of this post.

All of the code for this post can be found on my GitHub repository.

First you’ll need to install node on the Yún. Make sure you’ve upgraded to the current Yún software image and have connected to the internet via wifi. Then ssh into your Yún, or connect to the command line interface using the the YunSerialTerminal sketch, and issue the following commands:


$ opkg update
$ opkg install node

That’s it. Now you have node.js onboard. You can check that it’s okay by checking the version:

$ node -v

You should get the version number in reply.

Once you’ve got that working, you’ll undoubtedly want to communicate with the Yún’s Arduino processor from node. You can do this using the Bridge library. On a microSD drive, make a directory for your node scripts. I called mine /arduino/node. Then insert it into your Yún. For reference, its path from the command line is /mnt/sda1/arduino/node.

Note: The Yún automatically treats the microSD card’s /arduino/www/ directory as a public web directory. Anything you put in there will be served out as static HTML. So you may not want to put your node scripts in this directory, so they’re not visible via the browser. That’s why I created a node directory at the same level as the www directory, but outside it.

Read the complete post at this link>>

Arduino Blog 07 Jul 18:20

Controlling lights and sensors with Arduino Yún, Node js server and firmata

Arduino user Cinezaster sent us a project using Node js server on the Arduino Yún to control the lights, heating and some other sensors in the office of Appsaloon, the company where he’s doing an internship.

They already use Node.js for a lot of things and some of them are pretty cool with it.
That’s how they did it:

 

First of all you need to expand your flash, because there is not enough flash (16 MB) on the Arduino Yún. Sounds reasonable right? Not when you got the Yún for the first time in your hands. Luckily someone wrote this tutorial.

To start with you need to be on the same network to reach the Arduino .
Open your terminal

ssh root@arduino.local

It will ask for a password, which will by default be: ‘arduino’:

Now you can install Node.js on the Yún type :

opkg update
opkg install node

When the install is finished verify it by :

 node -v

It should give you something like this v0.10.28 (it may vary in the future)

Next you have to install the node-serialport package. This is necessary because the Atheros AR9331 needs to communicate with the ATmega32u4.

opkg update
opkg install node-serialport

After this you will need firmata for Node.js. This will control the inputs and outputs of the ATmega32u4.

Normally you would install firmata like this:

npm install firmata

But because the Arduino Yún does not have enough RAM this is ‘not possible’.

Keep reading it on their blog and fork it on Github!

Arduino Blog 03 Jun 19:33

Time to Expand your Yún disk space and install Node.js

Following the new Yún image, we are happy to announce two new features of the Arduino Yún.

  • The first feature is a tutorial we’ve written that allows you to use a micro SD card as a replacement for the Yún’s internal flash memory. Using this, you can expand your Yún’s free disk space from the original 7 Megabytes to the Gigabytes of your SD card.

Having more disk space allows you to make more complex projects, like activating webcams and saving pictures taken with it. In addition, by using an external SD card you avoid using the internal flash memory, thus extending the life of your Yún.

To upgrade your Yún to gain these features, follow the steps of the tutorial and report back to the Arduino Yún forum if you have any issues or questions.

  • The second new feature is the availability of Node.js as an installable package. In order to install Node.js on your Yún, use the Arduino IDE to upload the YúnSerialTerminal example or access your Yún via SSH.

Be sure your Yún has access to the internet, then type the following commands:

opkg update
opkg install node

And voilà! You’ve got Node.js on your Yún.

Try it out with the following command: 

node -e “console.log(‘Hello Yún’)”

If you are a Node.js fan, you probably want to use your favourite modules. Unfortunately, not every Node.js module is “pure javascript”, so some modules won’t work on the Yún. We are solving this by preparing packages for the most common native Node.js modules: we have already prepared node-serialport (opkg install node-serialport) and noble is on the way. If you miss your favourite one and want it added to the list, please consider joining us in developing the Yún.

Arduino Blog 06 May 11:46

Robot can barely move with so much hardware strapped to it

We think that [Andrej Škraba] needs to start looking for a beefier motor platform. This little robot has so much hardware strapped to it the motors can barely keep up. But with a little help it can make its way around the house, and it takes a whole lot of connectivity and computing power along for the ride.

The white stick on the top is a single-board computer. The MK802 Mini sports an A10 processor and up to a gig of ram. Just below that is a USB hub which is sitting on top of a USB battery pack. This powers the computer and gives him the ability to plug in more than one USB device. The robot chassis is from Pololu. It uses an Arduino and a motor shield for locomotion, with commands pushed to it via USB.

This setup makes programming very easy. Here [Andrej] has a keyboard and HDMI monitor plugged in to do a little work. When not coding it can be disconnected and driven over the network. He makes this happen using an Apache server on the MK802 and node.js. See a demo of the system in the clip after the break.


Filed under: robots hacks
Hack a Day 24 Dec 20:01

Toorcamp: Nibble Node.js Widget

The hardware hacking village at Toorcamp provided space and tools to work on hardware. It was interesting to see what hardware hacks people had brought to work on. One example is [Owen]‘s Nibble Node.js Widget. The widget combines the popular node.js platform and custom hardware to create a node for the “internet of things.” The hardware consists of a Arduino Pro Micro, a bluetooth module, a LCD display, and a speaker in a laser cut box.

By using a custom package in node.js, the Nibble becomes an object which can be controlled by its methods. This allows for the developer to push messages to the display and control the device without worrying about the details of the hardware. Since node.js is designed for web applications, it’s simple to make the device controllable from the web.

[Owen] also wrote an emulator for the DCPU from the upcoming game, 0x10c. DCPU assembly is passed in from node.js, which compiles it and sends it to the Nibble. The device can then run the application using the DCPU emulation, which also allows for control of the display and the speaker.

There’s a lot of neat things that can be done with this minuscule cube, and [Owen] plans to release an NPM package for the node.js code.


Filed under: cons
Hack a Day 20 Aug 13:30
arduino  cons  node.js  toorcamp  

Using the Raspi as an Ethernet shield

[Alexandre] wanted to set up a web-based temperature logger with his Arduino, but found the Arduino Ethernet shield a little finicky. Since his Raspberry pi was just delivered, he figured he could use the Raspi as an Ethernet shield with just a little bit of coding.

After [Alexandre] set up his Arduino to send a thermocouple through the USB, the only thing left to do was to add node.js to the Raspi’s Debian installation. Every five minutes, the Arduino wakes up, takes a temperature reading, and sends it over to the Raspberry pi. From there, it’s easy parse the Arduino’s JSON output and serve it up on the web.

In the end, [Alexandre] successfully set up his Raspberry pi as an Ethernet shield to serve a web page displaying the current temperature (don’t F5 that link, btw). One interesting thing we have to point out is the cost of setting up this online temperature logger: the Arduino Ethernet shield sells for $45 USD, while the Raspberry pi is available for $35. Yes, it’s actually less expensive to use a Raspberry pi as an Ethernet shield than the current Arduino offerings. There you have it, just in case you were still on the fence about this whole Raspi thing.


Filed under: arduino hacks, Rasberry pi

Publishing data on the web with Node.JS

Many solutions exist for publishing data coming from Arduino boards on the web. Bangon Kali, in his detailed tutorial, proposes his novel approach, which makes use of several widespread and open-source technologies, such as Node.JS, jQuery and Apache:

Using the USB, the Arduino Board is connected to the PC serially to a certain COM port which the OS allocates. Node.JS, the asynchronous server side JavaScript engine then listens for the port using a Node.JS module called SerialPort2. When a signal is received, using the Node.JS Socket.IO module, data is then served also asynchronously to the web providing a real time feed of the Arduino signal.

The tutorial (which can be applied on Linux, Mac OS and Windows) can be found here.

[Via: DangerousPrototypes and The Code Project]

Arduino Blog 05 Jun 15:31