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.
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 try: i=0 arduino = serial.Serial('/dev/ttyACM0', 9600) print "Connection successful" while True: data = arduino.readline() if data: try: values = [float(j) for j in data.split(" ") if len(j) > 2] print values except ValueError: print "invalid string:" print data i+=1 except: "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
the device should start showing numbers in arrays like [].
To stop simply press Ctl+Z
Congratulations! The device is seen by the system.
Fast interface based on TakkFast
(to be added)
Contact us: here