/* * Kira Stoy * Project Part 01 */ byte sensor = 5; const int AOUTpin=0; const int DOUTpin=8; int ledPin= 11; int value; void setup() { Serial.begin(115200);//sets the baud rate pinMode(AOUTpin, INPUT);//sets the pin as an input to the arduino pinMode(ledPin, OUTPUT);//sets the pin as an output of the arduino } void loop() { { value= analogRead(AOUTpin);//reads the analaog value from the alcohol sensor's AOUT pin Serial.print("Alcohol value: "); Serial.println(value);//prints the alcohol value delay(100); if (value >= 500){ digitalWrite(ledPin, HIGH);//if limit has been reached, LED turns on as status indicator } else{ digitalWrite(ledPin, LOW);//if threshold not reached, LED remains off } } }