1
TinyDuino Processors & TinyShields / Re: Accelerometer Shield
« on: June 28, 2013, 04:09:50 PM »
Sure thing Ken!
Just to sweeten the deal, here's a processing sketch that simply receives the serial stream from the previous code and prints the data out:
Note that you may have to change the Serial.list()[] number to something other than 4 (I was able to just count down the options in the menu, fifth option, #4!).
thanks for the tiny hardware Ken!
ak
Just to sweeten the deal, here's a processing sketch that simply receives the serial stream from the previous code and prints the data out:
Code: [Select]
import processing.serial.*;
Serial myPort;
float value;
int x,y,z;
int[] dataArray;
void setup()
{
myPort = new Serial(this, Serial.list()[4], 115200);
}
void draw()
{
}
void serialEvent(Serial p) {
// get message till line break (ASCII > 13)
String message = myPort.readStringUntil(13);
if (message != null) {
println(message);
}
}
Note that you may have to change the Serial.list()[] number to something other than 4 (I was able to just count down the options in the menu, fifth option, #4!).
thanks for the tiny hardware Ken!
ak