Raspberry PI


This tutorial covers the basic steps required to connect TakkTile sensors to the Raspberry PI.
There are two possible configurations:
a) Serial interface for Arduino (to which a TakkStrip is connected)
b) Fast interface based on TakkFast (which is connected to TakkStrip or TakkArray)

Serial interface for Arduino

by Dobra Mila

This setup will require a Raspberry PI, Arduino and a TakkStrip.

Configuration Steps

1. Prepare a card for your Raspberry Pi with operating system (might be NOOBS from http://www.raspberrypi.org/downloads - requires only coping to card and starting the RaspberryPi).
A configuration with custom settings might be useful, but it is not necessary.
A nice configuration guide is on the page (here) starting from “BOOTING YOUR PI FOR THE FIRST TIME”.

Ethernet is accessible immediately, while wifi (if you have wiPi) can be configured by WiFi Config (very intuitive, if any guide is needed then go to here) .

2. It is essential to install at least package required by pyserial.py. Might be in console by typing

sudo apt-get install python-serial

3. Connect the sensor strip
a. Open the catalog with devices /dev
b. plug takktile+audrino and check what appears, probably it will be ttyACM0
c. copy the code or modify it the so that it points to the device :

#!/usr/bin/env python
import serial, time
    arduino = serial.Serial('/dev/ttyACM0', 9600)
    print "Connection successful"
    while True:
        data = arduino.readline()
        if data:
                values = [float(j) for j in data.split(" ") if len(j) > 2]
                print values
            except ValueError:
                print "invalid string:"
                print data
    "Connection failed"

d. open console, change directory to the one containing the file
e. change the access rights by writing

sudo chmod a+x tester.py

f. run the script by
sudo ./tester.py

the device should start showing numbers in arrays like [[235][242][197][256][251]].
To stop simply press Ctl+Z

Congratulations! The device is seen by the system.

Fast interface based on TakkFast

(to be added)

Questions ?

Contact us: here

wordpress com stats

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial 3.0 License