- //Muhammadi & Abasi
- void setup() {
- Serial.begin(9600);
- pinMode(3, OUTPUT);
- }
- void loop() {
- float read_val;
- read_val = analogRead(A0);
- float evaluated;
- evaluated = (read_val * 20)/1023;
- Serial.print("measured voltage: ");
- Serial.println(evaluated);
- float buzzer_control;
- buzzer_control = analogRead(A2);
- if(buzzer_control < 255 && buzzer_control > 240){
- digitalWrite(3, HIGH);
- }
- else{
- digitalWrite(3, LOW);
- }
- }
Recent Pastes