Arduino UNO :My code doesnt work and im desperate for

Ive been writing my code for an assignment due tomorrow, ive worked on each part seperatly and when putting them together, they don’t work. Ive tried for hours to make it work but it wont anymore…

In my assignement. i need to a program that has 3 modes, Normal mode (where the leds should run on the timer set) Pedestrain mode (where this is a mode where is uses pedistrain mode but interupt the code/play a tone on a piezeo buzzer when a person is 10cm from the sensor) NIght mode (where if the intesisty is below 10 then the light should turn red, but apart from that,it should work in as it does in led mode.

a person should be able to click each mode and it should stay in each mode until a user changes it in the serial monitor

my code:

#define buzzer 5
#define redPin 4
#define yellowPin 3
#define greenPin 2
#define ECHOPIN 13
#define TRIGPIN 12
#define sensorPin A0
float distance;
unsigned int sensorValue = 0;  
float voltage;


void setup()
{
  pinMode(greenPin,OUTPUT);
  pinMode(yellowPin,OUTPUT);
  pinMode(redPin,OUTPUT);
  pinMode(buzzer,OUTPUT);
  
  Serial.begin(9600);
  pinMode(ECHOPIN,INPUT);
  pinMode(TRIGPIN,OUTPUT);

void start()
{
Serial.read

   if Serial.read = 1
   {
    goto int ultrasonic 
   }
   or Serial.read = 2
   {
    goto int LDR
   }
    else int normal

}

int normal = 0
{
void loop()
{
  digitalWrite(2,HIGH);
  delay(2000);
  digitalWrite(2,LOW);

  digitalWrite(3,HIGH);
  delay(1000);
  noTone(5);
  digitalWrite(3,LOW);

  digitalWrite(4,HIGH);
  delay(2000);
  digitalWrite(4,LOW);

  digitalWrite(3,HIGH);
  delay(1000);
  noTone(5);
  digitalWrite(3,LOW);
}
}


int ultrasonic = 2
void loop()
{
  digitalWrite(TRIGPIN,LOW);
  delayMicroseconds(100);
  digitalWrite(TRIGPIN,HIGH);
  delayMicroseconds(500);
  digitalWrite(TRIGPIN,LOW);
  distance = pulseIn(ECHOPIN,HIGH);
  distance = distance/58;

  digitalWrite(2,HIGH);
  goto step1
  delay(2000);
  goto step1
  digitalWrite(2,LOW);
  goto step1

  digitalWrite(3,HIGH);
  goto step1
  delay(1000);
  goto step1
  noTone(5);
  goto step1
  digitalWrite(3,LOW);
  goto step1

  digitalWrite(4,HIGH);
  goto step1
  delay(2000);
  goto step1
  digitalWrite(4,LOW);
  goto step1

  digitalWrite(3,HIGH);
  goto step1
  delay(1000);
  goto step1
  noTone(5);
  goto step1
  digitalWrite(3,LOW);
}


int step1 = 2
{
void loop
{
    if (cm < 10)
    {
      for (int i = 0; i < 10; i++)
      {
        digitalWrite(yellowPin, HIGH);
        tone(buzzer,1000);
        delay(100);
        digitalWrite(yellowPin, LOW);
        noTone(buzzer);
        delay(100);
      }
      else continue
    }
}

int ldr
{
void loop()
{
  
  sensorValue = analogRead(sensorPin);    
  voltage = sensorValue * (5000.0 / 1024.0);
  Serial.print("Sensor Output: ");
  Serial.println(sensorValue);
  Serial.print("Voltage (mv): ");
  Serial.println(voltage);
  Serial.println();
  delay(1000);
}
}

Firstly, welcome to the forums.

You have not explained what you are expecting your code to do and then what it does instead.

Also, you should probably put the language somewhere in the topic title, so people familiar with that language can easily find it.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums