Arduino Battery Project - IamCK

Arduino Battery Project

SETB 2113 INTRODUCTION TO PROGRAMMING

ArduinoBatteryProject

The source code for this project

      
      
        float refvolts = 5.0;
        int inputPin1 = A1;
        int inputPin2 = A2;

        void setup() {
          Serial.begin(9600);
        }

        void loop() {
          int val1 = analogRead(inputPin1);
          int val2 = analogRead(inputPin2);

          float volts1 = (val1/1023.0)*refvolts ;
          float volts2 = (val2/1023.0)*refvolts ;

          Serial.print("Volts1 = ");
          Serial.println(volts1);
          Serial.print("Volts2 = ");
          Serial.println(volts2);

          delay(1000);
        }

The diagram of this project:

Another version of this site avalable at here

Thanks for visting

CC0
To the extent possible under law, ck has waived all copyright and related or neighboring rights to this work. This work is published from: Malaysia.

According to relevant laws and regulations, this site is not available to EU users