Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How and where would I add eeprom read and write to my code using an Arduino mega? This is what I have.... #include #include RTClib.h

How and where would I add eeprom read and write to my code using an Arduino mega? This is what I have....
#include #include "RTClib.h" RTC_DS1307 RTC; int analogInput = A1; float vout = 0.0; float vin = 0.0; float R1 = 30000.0; // float R2 = 7500.0; // int value = 0; void setup(){ pinMode(analogInput, INPUT); Serial.begin(9600); Serial.print("DC VOLTMETER"); Serial.begin(9600); Wire.begin(); RTC.begin(); if (! RTC.isrunning()) { Serial.println("RTC is NOT running!"); // following line sets the RTC to the date & time this sketch was compiled RTC.adjust(DateTime(__DATE__, __TIME__)); } } void loop(){ // read the value at analog input value = analogRead(analogInput); vout = (value * 5.0) / 1024.0; // see text vin = vout / (R2/(R1+R2)); DateTime now = RTC.now(); Serial.print(now.year(), DEC); Serial.print('/'); Serial.print(now.month(), DEC); Serial.print('/'); Serial.print(now.day(), DEC); Serial.print(' '); Serial.print(now.hour(), DEC); Serial.print(':'); Serial.print(now.minute(), DEC); Serial.print(':'); Serial.print(now.second(), DEC); Serial.println(); delay(5000); Serial.print("INPUT V= "); Serial.println(vin,2); delay(5000); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

Working with other project stakeholders for support.

Answered: 1 week ago

Question

Knowledge of project management (PMI) teachings

Answered: 1 week ago