CPP 192
Voltmeter Guest on 26th January 2024 12:01:57 PM
  1. //Muhammadi & Abasi
  2. void setup() {  
  3.   Serial.begin(9600);
  4.   pinMode(3, OUTPUT);
  5. }
  6.  
  7. void loop() {
  8.   float read_val;
  9.   read_val = analogRead(A0);
  10.   float evaluated;
  11.   evaluated = (read_val * 20)/1023;
  12.   Serial.print("measured voltage: ");
  13.   Serial.println(evaluated);
  14.  
  15.   float buzzer_control;
  16.   buzzer_control = analogRead(A2);
  17.   if(buzzer_control < 255 && buzzer_control > 240){
  18.     digitalWrite(3, HIGH);
  19.   }
  20.   else{
  21.     digitalWrite(3, LOW);
  22.   }
  23. }

Hightechrobo bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.