TEXT   34

Untitled

Guest on 24th November 2021 01:46:59 AM

  1. float vol=0;
  2. int input=0;
  3. void setup()
  4. {
  5.   pinMode(A0,INPUT);
  6.   Serial.begin(9600); // starting the Serial Monitor
  7.  
  8. }
  9. void loop()
  10. {
  11.   input=analogRead(A0); //analogRead function is used to recive analog data
  12.   vol=(input*5.0)/1024.0;//formula using for perform action
  13.   Serial.print("voltage is:");
  14.   Serial.println(vol);
  15.   delay(500);
  16. }

Raw Paste


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