// Test 01: get data measurements from a light sensor // and send them formatted to the serial port // // // // modifyied from Example 07 // from http://makezine.com/getstartedarduino/ #define SENSOR 0 // select the input pin for the // sensor resistor int val = 0; // variable to store the value coming // from the sensor void setup() { Serial.begin(9600); // open the serial port to send // data back to the computer at // 9600 bits per second } void loop() { val = analogRead(SENSOR); // read the value from // the sensor Serial.print(0xff, BYTE); // Sync byte Serial.print((val >> 8) & 0xff, BYTE); Serial.print(val & 0xff, BYTE); delay(100); // Wait 100 milliseconds }