lereqop.blogg.se

Arduino wire library functions
Arduino wire library functions










First, let's take a look at the master code: // Include the required Wire library for I2C#include I don't know what DS1307 stores if we add a date that "does not exist".The following code is split in two parts: the master code and the slave code, which run on two different Arduinos. I'll add to ToDo of the project the test of calendar capabilities such months like Feb etc. If no, it is just another information we can get (it'll increment from 1 to 7 for us each 24 hour) if we set the right value. If yes, so I can determine the day of week based on year, month and day. I didn't read about the day of week in the datasheet and don't know if DS1307 have calendar capabilities yet.

arduino wire library functions

But it won't force the date to be valid for the month/year. Seems to know if the current m/d/y is the last day of the month - and if so, it will roll to the next month at midnight. Similarly, it is perfectly happy to let you set the date to Feb 30. or 1=Thursday for that matter (if you can get the hang of Thursdays.).

arduino wire library functions

Convenient in some ways as you are perfectly able to define 1=Sunday, 1=Monday. It does not seem to have any fixed association between the date/month/year and what day of the week it is. Don't know if you noticed, but all the clock does in increment the day of the week by one (rolling from 7 to 1) every time it hits midnight. Was looking at your code, alvarojusten, saw the function to represent the day of week as a string. What if other libraries work with other two-wire devices? Are we going to have scope issues for the Wire object? Multiple Wire objects in different scopes? But that's something for another thread.) (Also wondering about intializing Wire for the class object.

arduino wire library functions

I appreciate the mention of the Playground code even though it's far simpler than I need, I'm still new at Arduino and C++, so models that show how to do the extern thing to set up the class for the user are helpful. So am providing functions for more of the nitty-gritty details of the chips capabilities. The main difference between my library and the other two is that I need to use the square wave output and the chip's battery-backed RAM memory (rather than burn out the EEPROM). I just wrote a library for the 1307, too Was trying to share mine through playground, but the registration page seems to be down.












Arduino wire library functions