background preloader

Dr. Monk's DIY Electronics Blog: Raspberry Pi and Arduino

Dr. Monk's DIY Electronics Blog: Raspberry Pi and Arduino
Note. There is now a followup to this post here. The Raspberry Pi is creating quite a storm of interest. I have just got mine and one of the first things that I wanted to try was to get it talking to an Arduino over USB using Python. .. and you know what? Arduino Let's start with the Arduino end. Here is the sketch - paste it into a new Arduino IDE window and load it up onto your Arduino using your regular computer. const int ledPin = 13;void setup(){ pinMode(ledPin, OUTPUT); Serial.begin(9600);}void loop(){ Serial.println("Hello Pi"); if (Serial.available()) { flash(Serial.read() - '0'); } delay(1000);}void flash(int n){ for (int i = 0; i < n; i++) { digitalWrite(ledPin, HIGH); delay(100); digitalWrite(ledPin, LOW); delay(100); }}Raspberry Pi There is a Python library for serial communications called 'pySerial' which has history with Arduino. Step 1. Step 2. Step 3. Step 4. Step 5. Thats it! You type the parts after >>> import serialser = serial.Serial('/dev/ttyACM0', 9600) ls /dev/tty*

RasWIK - Raspberry Pi Wireless Inventors Kit Product description The Wireless Inventors Kit for the Raspberry Pi (RasWIK) is an exciting and affordable addition to the Raspberry Pi. RasWIK demonstrates that with our leading edge technology anyone (and we mean anyone) can build wireless sensors and actuators , you do not need huge experience, a degree or even any tools. We show you even how to connect the devices you build to “the Internet of Things” (IoT) service providers such as Xively. Getting started is just 5 simple steps: 1. You can build wireless devices in just a matter of minutes. There are 29 fully documented projects. Out of the box all the hardware is configured to start you off without you writing a single line of code. In a review of RasWIK in the October 2013 issue of Custom PC , Gareth Halfacree (co author of the Raspberry Pi manual) said: "It provides possibly the simplest platform for experimenting with wireless sensor networks I’ve ever seen." The youngest WIKer we know of is just 8 years old! Features: Downloads

Related: