background preloader

Raspberry Pi avec Node.js et Arduino - Doc’ Alex

Raspberry Pi, Python & Arduino | We Saw a Chicken … After the other night’s wonderfully slow detour into Processing, I thought I’d try the Raspberry Pi’s “native” language of Python to control an Arduino. This worked rather well, though I don’t have a slick GUI for it yet. pyFirmata is the magic that allows an Arduino running Firmata to talk to Python. It’s fairly easy to install under Raspbian: Get the required packages:sudo apt-get install python-serial mercurialDownload the pyFirmata code:hg clone cd pyfirmata sudo python install (If this succeeds, you can delete the pyfirmata folder.) Using pyFirmata is a bit different from other Arduino applications: Here’s some code that uses the same hardware as before, but simply reports the temperature and ramps the brightness of the LED up in 10% steps. The output from this might look like: If this doesn’t work, check the output of dmesg to see if you’re using the right port. which should generate something like Send the author to the moon!

Raspberry Pi + Arduino + SPI This tutorial will show you how to communicate from your raspberry pi to your arduino using 3-wire SPI. Requirements 1 Raspberry pi (running Raspbian)1 Arduino4 wires Your raspberry pi should be running the newest version of Raspbian. To ensure your system is up-to-date please download and run rpi-update. Wiring Arduino Open your Arduino ide and flash the below code to your Arduino. Arduino code Raspberry Pi With your updated rasbian system you should have the drivers that you need. modprobe spi_bcm2708 modprobe spidev Check to be sure the modules loaded: lsmod Module Size Used by spidev 5944 0 spi_bcm2708 5350 0 snd_bcm2835 21681 0 snd_pcm 81170 1 snd_bcm2835 snd_seq 59528 0 snd_timer 21602 2 snd_seq,snd_pcm snd_seq_device 6924 1 snd_seq snd 57427 5 snd_seq_device,snd_timer,snd_seq,snd_pcm,snd_bcm2835 snd_page_alloc 5343 1 snd_pcm i2c_bcm2708 3822 0 Raspberry Pi Code Save the below code as spidev_test.c on to your Raspberry Pi and compile it gcc spidev_test.c -o spidev_test Running sudo . Debugging

Raspberry Pi Raspberry Pi OpenCV Pan & Tilt Face Tracker Create your own face tracking, pan and tilt camera on the Raspberry Pi! This tutorial will demonstrate use of the OpenCV (computer vision) library to identify and track faces on the raspberry pi using two servos and a USB webcam. This project is based on the OpenCV face tracking example that comes along with the source-based distribution. Using the coordinates of the rectangle vertices, my script calculates the (X,Y) position of the center of the face. Hardware Parts needed: 512 MB raspberry pi2x Hobby servos (Turnigy 9g fom Hobby King)Pan & tilt bracket (from Foxtech FPV)USB webcam (Microsoft LifeCam Show from Amazon)Power supplyHook-up wireRaspberry Pi enclosure (from Built to Spec) Assembly Connect the red, power lines of the servos to +5v, the black ground lines to GND, and the yellow signal lines to the desired output pins, GPIO pins 22 and 23 in the example. And here is how it looks all put together: Software Get the source. Software Hardware

Raspberry Pi and Arduino via GPIO UART | In an attempt to get my Raspberry Pi talking to my Arduino I’m exploring various different options. The first was to just use the USB connection, but that was too simple. So, here is how to connect the two using the UART on the GPIO pins of the Raspberry Pi. To make testing easier I wanted to keep the Arduino’s serial connected via USB to my PC so I can print messages there and read it with the Serial Monitor. To show how this works the Arduino is running a small program that reads from the Raspberry Pi’s and copies this to my PC via USB. By default the Raspberry Pi uses the UART in two ways: Console Messages (including bootup messages)A getty so you can login via serial To use this serial port for your own uses you need to disable these two services. To change the console baudrate, edit /boot/cmdline.txt to look like this (this is all one line): dwc_otg.lpm_enable=0 console=ttyAMA0,9600 kgdboc=ttyAMA0,9600 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait Connected to PC

Format SD Card Firstly, you need to install the Debian image onto an SD card (2GB or more). (The image can be downloaded from You can do this using the Win23DiskImager tool for Windows (downloaded from Insert your SD card. Once the write process has finished, you can remove the SD card, then the fun begins. Bald Wisdom » Blog Archive » Introducing Raspbery Pi à la mode Our first prototypes are back, and working quite well! SeeedStudio fabricated the prototype boards and quickly sourced the parts. The boards were of excellent quality. If you haven’t been following, Anool Mahidharia, Justin Shaw and I from the OSHW collaborative have been developing a stackable Arduino compatible for the Raspberry Pi. While there are lots of emerging examples of interfacing hardware to the Pi, it’s just not as easy as the Arduino, and the Arduino already has hundreds of libraries for interfacing with motors, sensors, and displays. Here are the features including a few extra goodies: Flexible power. We’re in limited Beta right now, but as soon as it’s thoroughly tested, we hope to produce them for sale as soon as we can! share

Hacker uses Kindle as Raspberry Pi screen High performance access to file storage A hacker named Gef has rigged up his Raspberry Pi to use a Kindle e-reader as its monitor. “Hacker” may not quite be the word, actually, as the individual responsible identifies himself as an “eclectic yogi discovering the world of computational art and new media” on the blog post where the recipe for the KindleBerry Pi is revealed. Names aren't the guy's long suit either: his Twitter account says he's called “Gef” although his handle is @damarusama. We'll nonetheless proceed on the basis this is the work of a human, not a canine, and report that the way to achieve the feat of using a Kindle as a Pi's monitor requires you to: "Jail break the Kindle, install this terminal emulator … and then install UsbNetwork. At this point it is apparently possible to use the Kindle's keyboard to control the Pi, but as the display operates in landscape mode the keyboard is at a 90 degree angle to the screen.

Give functionality to the menu items and components. 1. At the top of (“Your Project Name”).cpp, define the following enumeration and variable as shown in picture 4-1: enum operation {ADD,SUB,MULT,REM}; operation op = ADD; This will be used to keep track of what operation the user has selected. 2. 3. 4. 5.