Help with Code?

trying to upload this code to my arduino but I get errors? i tried fixing it and it still give me errors? I tried the compile tab; I changed stuff around it still wont work? this is for a dust sensor!

int inputPin=0;
int inputVal=0;
int ledPower=2;
int delayTime=280;
int delayTime2=40;
float offTime=9680;
void setup(){
  Serial.begin(9600);
  pinMode(ledPower,OUTPUT);
  pinMode(4, OUTPUT);
}

void loop(){

digitalWrite(ledPower,LOW);

 delayMicroseconds(delayTime);
  inputVal=analogRead(inputPin)/4;
  delayMicroseconds(delayTime2);
digitalWrite(ledPower,HIGH);
   
  //Serial.print("Value: ");
  Serial.print(inputVal,byte());
  delayMicroseconds(offTime);
  if(inputVal>60){
    for(int i=0; i<4;i++){
     buzz(4, 2500, 500); // buzz the buzzer on pin 4 at 2500Hz for 1000 milliseconds
  delay(1000); // wait a bit between buzzes
    }
  }
}

void buzz(int targetPin, long frequency, long length) {
  long delayValue = 1000000/frequency/2; // calculate the delay value between transitions
  //// 1 second's worth of microseconds, divided by the frequency, then split in half since
  //// there are two phases to each cycle
  long numCycles = frequency * length/ 1000; // calculate the number of cycles for proper timing
  //// multiply frequency, which is really cycles per second, by the number of seconds to 
  //// get the total number of cycles to produce
 for (long i=0; i < numCycles; i++){ // for the calculated length of time...
    digitalWrite(targetPin,HIGH); // write the buzzer pin high to push out the diaphram
    delayMicroseconds(delayValue); // wait for the calculated delay value
    digitalWrite(targetPin,LOW); // write the buzzer pin low to pull back the diaphram
    delayMicroseconds(delayValue); // wait againf or the calculated delay value
  }
}
import processing.serial.*;
Serial myPort;  
PFont myFont;    
int j = 70;                   // counter
int inByte=0;
int wrote = 0;


void setup () {
  size(800, 600);        // window size
  frameRate(60);

  myFont = loadFont("ArialMT-12.vlw"); 
  textFont(myFont, 12); 
  textAlign(LEFT);
  
  fill(#E9FF5B, 200);
  smooth(); 

  // set inital background:
  background(#000000, 200);
  
  println(Serial.list());
  myPort = new Serial(this, Serial.list()[2], 9600);



}

void draw()
{
 fill(0,1);
  rect(0,0, width, height); 
  stroke(255);
  strokeWeight(1);
  line(70,550,800,550);
  line(70,38,70,550);
  textFont(myFont, 16); 
  fill(#FFFFFF);

  text("0V", 32, 550 );
  text("1", 32, 447 );
  text("2", 32, 345 );
  text("3", 32, 242 );
  text("4", 32, 140 );
  text("5V", 32, 37 );
  
  for (int i=0; i<6;i++){
    line(63,550-(i*102.4),77,550-(i*102.4));
  }
  stroke(230);
  strokeWeight(1);
   for (int i=0; i<6;i++){
    line(66,598.8-(i*102.4),74,598.8-(i*102.4));
  }
  while (myPort.available() > 0) {
    inByte = myPort.read()*2;
  }
  
   // if (inByte==254){
   //  incoming=myPort.read();
     // dev=myPort.read();
  //  }
    
  stroke(#555FFF,200);
  fill(255);
 
   line(j, 550-inByte, j,550);   
      

        // stroke(#55FF55,70);
   // fill(#FF555F);
  //ellipse(j, height/2 + dev, 2, 2);
    

  if (j > width) {
    j =70;
    background(#000000);
    fill(0,1);
    rect(0,0, width, height); 
   } 
  else {
    j++;
  }

 if (wrote >20)
  {
  fill(#FFFFFF);
  textFont(myFont, 12); 
  text(inByte/2, j,  (550- inByte)-30);
  wrote = 0;
  }
  wrote++;

}

anthony8i:
trying to upload this code to my arduino but I get errors? i tried fixing it and it still give me errors? I tried the compile tab; I changed stuff around it still wont work? this is for a dust sensor!

The Arduino code compiles just fine on my system. What error are you getting?

The Processing code won't run on my Mac because it can't load the font "ArialMT-12.vlw".

johnwasser:

anthony8i:
trying to upload this code to my arduino but I get errors? i tried fixing it and it still give me errors? I tried the compile tab; I changed stuff around it still wont work? this is for a dust sensor!

The Arduino code compiles just fine on my system. What error are you getting?

The Processing code won't run on my Mac because it can't load the font "ArialMT-12.vlw".

for the second code it tells me its a stray in the program? I believe i fixed the first code it was using older commands

anthony8i:
for the second code it tells me its a stray in the program?

A "stray in the program" makes no sense. Please post the exact error message. What version of Processing are yo running on your PC? I'm using 1.2.1 and it got as far as trying to load the font.