I grabbed this example:
* Reads an analog input from the input pin and sends the value
* followed by a line break over the serial port.
* This file is part of the Arduino meets Processing Project:
* For more information visit http://www.arduino.cc.
* copyleft 2005 by Melvin Ochsmann for Malm� University
// variables for input pin and control LED
int analogInput = 3;
int LEDpin = 13;
// variable to store the value
int value = 0;
// a threshold to decide when the LED turns on
int threshold = 512;
// declaration of pin modes
// begin sending over serial port
// read the value on analog input
value = analogRead(analogInput);
// if value greater than threshold turn on LED
if (value < threshold) digitalWrite(LEDpin, HIGH); else digitalWrite(LEDpin, LOW);
// print out value over the serial port
// and a signal that serves as seperator between two values
// wait for a bit to not overload the port
I glommed it from http://webzone.k3.mah.se/projects/arduino-workshop/projects/arduino_meets_processing/instructions/ldr.html
The code fragment:
caused it to throw an obvious exception,
"ap_ReadAnalog.cpp: In function 'void setup()':
ap_ReadAnalog:30: error: 'beginSerial' was not declared in this scope
ap_ReadAnalog.cpp: In function 'void loop()':
ap_ReadAnalog:41: error: 'printInteger' was not declared in this scope
ap_ReadAnalog:44: error: 'printByte' was not declared in this scope"
I confess I don't know really know what it means. here. It may have worked for the release available in 2005, but definitely not for 0022..