Hi.....am making a project on infrared pulse sensor and am getting an error in this program while Processing......i have my project submission in sometime.....plzz plzz do help....this is program where am getiing error
// Based on examples from Arduino's Graphing Tutorial and OscP5 documentation
import processing.serial.*;
Serial myPort; // The serial port
int xPos = 1; // horizontal position of the graph
float oldHeartrateHeight = 0; // for storing the previous reading
void setup () {
// set the window size:
size(600, 400);
frameRate(25);
// List available serial ports.
println(Serial.list());
// Setup which serial port to use.
// This line might change for different computers.
myPort = new Serial(this, Serial.list()[1], 9600);
// set inital background:
background(0);
}
void draw () {
}
void serialEvent (Serial myPort) {
// read the string from the serial port.
String inString = myPort.readStringUntil('\n');
if (inString != null) {
// trim off any whitespace:
inString = trim(inString);
// convert to an int
println(inString);
int currentHeartrate = int(inString);
// draw the Heartrate BPM Graph.
float heartrateHeight = map(currentHeartrate, 0, 1023, 0, height);
stroke(0,255,0);
line(xPos - 1, height - oldHeartrateHeight, xPos, height - heartrateHeight);
oldHeartrateHeight = heartrateHeight;
// at the edge of the screen, go back to the beginning:
if (xPos >= width) {
xPos = 0;
background(0);
} else {
I hope this is a school project and not something that anyone is actually going to need. "plzz plzz do help" does not inspire confidence.
As for the actual post:
Hi.....am making a project on infrared pulse sensor and am getting an error in this program while Processing......i have my project submission in sometime.....plzz plzz do help....this is program where am getiing error
supra21196, please read the sticky posts on the sub, in particular read point 6 of "read this before posting a programming question". Your post is exactly the kind of post that that particular point is about. You are simply not going to get any help at all until you make a post that contains the stuff that people need for to be able to help you.