HELP NEEDED IMMEDIATELY

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 {

Why dont you tell us what's the issue with the code, rather than we guess something?

Is this your complete code? If then where is the closing bracket after the last line of your code, after 'else'.

Use Code tag to post your code.

I see your problem but I can't stand the screaming, so good luck.

If you need help immediately pay a professional.

If you want free help be patient and don't rudely demand that your problem jumps to the top of the queue in front of other people's problems.

...R

    float heartrateHeight = map(currentHeartrate, 0, 1023, 0, height);

Calculate an integer value, and then store the result in a float.

line(xPos - 1, height - oldHeartrateHeight, xPos, height - heartrateHeight);

Pass that float to a function that expects an integer.

Can I have some of what you were smoking?

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.