Hi, not quite sure where to post my first query but here seemed like a likely candidate. I have been having a lot of fun with Arduino and have come across a project
that uses Processing to create a visual representation of temperature readings from a LM35 sensor.I am not sure how the forum likes code pasted but I am sure a kind Mod will advise me.
import processing.serial.*;
//init variables
Serial commPort;
float tempC;
float tempF;
int yDist;
PFont font12;
PFont font24;
float[] tempHistory = new float[100];
void setup()
{
//setup fonts for use throughout the application
font12 = loadFont("Verdana-12.vlw");
font24 = loadFont("Verdana-24.vlw");
//set the size of the window
size(210, 200);
//init serial communication port
commPort = new Serial(this, "COM10", 9600);
//fill tempHistory with default temps
for(int index = 0; index<100; index++)
tempHistory[index] = 0;
}
void draw()
{
//get the temp from the serial port
while (commPort.available() > 0)
{
tempC = commPort.read();
//refresh the background to clear old data
background(123);
//draw the temp rectangle
colorMode(RGB, 160);//use color mode sized for fading
stroke (0);
rect (49,19,22,162);
//fade red and blue within the rectangle
for (int colorIndex = 0; colorIndex <= 160; colorIndex++)
When I run the Processing code and upload the Arduino code I get this notification -
WARNING:RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
I have not as yet constructed my circuit, but I thought that I would just see if the code would compile, which it does. The Processing window that opens when I run the sketch is displaying the temperature graphic, which is presumably reacting to the fluctuating voltage on the open analog pin of the Arduino. Is the error that I described above of any consequence or not. Thank you for taking the time to read this. Pedro.