r/badcode • • Nov 10 '20

c++ My teacher's code formatting

Post image
983 Upvotes

60 comments sorted by

View all comments

58

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Nov 10 '20 edited Nov 10 '20

Image Transcription: Code


void setup()
{
  pinMode(12, OUTPUT);
  Serial.begin(9600);
}

void loop()
{int light=analogRead(A0);
 Serial.println(light);
  if(light>250)
  {digitalWrite(12,HIGH);
  }
 else
 {digitalWrite(12,LOW);
}
}

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

26

u/adamski234 Nov 10 '20

Line 8, unrecognized identifier: anologRead. Did you mean analogRead?

19

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Nov 10 '20

Fixed, thanks!