Processing is a software sketchbook and a language for learning in the context of the visual arts. I think a good way to introduce this language is with an experiment like interacting with an in put device as a potentiometer, that interact with the visual output in the computer with Procesing.
A clear and usefull web page with resources to learn and examples is https://processing.org/, from beginning to advanced.
For the purposse of the experiment, is the same using a temperature device or a potentiometer, because both are analog devices. But I choose to work with a potentiometer to obtain a real interact feature of the system.
The diagram connection is as the figure. A potentiometer conected to Fabduino, and Fabduino conected to the PC via a TTL-USB cable
Doing the connections
And the sketch to be uploaded to Fabduino/Arduino is the one found at Arduino / File / Examples / ReadAnalogVoltage
First is convenient to visualize how the analog signal varies in the serial monitor in the Fabduino. To do that, I upload this sketch to Fabduino.
/*
ReadAnalogVoltage
Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
Serial.println(voltage);
}
And the result:
Now, in Processing, the program to execute this is based in some basic programs found in https://processing.org/examples/
A good programming reference could be found at https://processing.org/reference/
Once I did that, I launched the Processing environment.
I build this program based on some examples, the program reads the serial port (receiving from Fabduino/Arduino), and with a proportional value change the radious of some ellipses.
The program couldn't read the values of the analog device. I was trying varying the baud rate, and changing the pins readed, but coudn't find the problem.
I changed the fabduino with the Arduino Uno, and try again. By the way, one tip to find the port connected to the Arduino is look in the Arduino IDE, in the PORT option, as in the picture.
With that value, you can change the port definition in the Processing environment. In my case was "COM5"
The program reads the analog value of the potentiometer via the serial port, and with that value dinamically changes a radio of some ellipses.
In the video you can see the processing program running, while moving the potentiometer.