Advertisement
DrAungWinHtut

analog_read.ino

Nov 18th, 2024
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // C++ code
  2. //
  3. void setup()
  4. {
  5.   pinMode(A0, INPUT);
  6.   pinMode(13,OUTPUT);
  7.   Serial.begin(9600);
  8. }
  9.  
  10. void loop()
  11. {
  12.   float value = analogRead(A0);
  13.   Serial.println(value);
  14.   float voltage = value * 5 / 1023;
  15.   Serial.println(voltage);
  16.   delay(5000);
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement