![]() ![]() Wire.write(0) // sets DS3231 register pointer to 00h function to read time from DS3231 and create timestamp# function to convert BCD time values to ASCII characters Serial.println(timestamp) // prints timestamp ![]() variables to store DS3231 register values in BCD formatĬhar timestamp // character variable to store timestampĬhar * pt // character variable to store pointer (needed to make timestamp) Thanks! That made it work! Working code: #include "Wire.h" The parts that have: pt++ = ':' and similar ones give these errors. Sketch_apr29c:47: error: lvalue required as left operand of assignment Sketch_apr29c:46: error: lvalue required as left operand of assignment Sketch_apr29c:45: error: lvalue required as left operand of assignment Sketch_apr29c:43: error: lvalue required as left operand of assignment Sketch_apr29c:41: error: lvalue required as left operand of assignment Sketch_apr29c:39: error: lvalue required as left operand of assignment Sketch_apr29c:37: error: lvalue required as left operand of assignment Sketch_apr29c.ino: In function 'void loop()': request seven bytes of data from DS3231 starting from register 00h Wire.write(0) // set DS3231 register pointer to 00h Wire.beginTransmission(DS3231_I2C_ADDRESS) I have tried to change the code to convert directly from BCD to ASCII but it gives an error. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |