I am having problems getting the code to compile. It is now, I think, asking to include #include <Adafruit_I2CDevice.h>
In the code I copied, this file isnt written. Its as though the compiler is saying it should be.
You best be when starting out is to use the library examples and get to understand how and why the work .
And then develop your own stuff .
As you’ve seen copy stuff from the net often causes issues with newcomers
It is code from this site, the arduinocc, this site, the one I am posting on now.
Link Tutorial on how to use DS3231 RTC Module | Arduino Project Hub
He has posted it for people to use. It says it works. He has video, Ive watched, Ive got all the items needed and he posted different codes. I would have thought that if they were on this site listed as working , that they do indeed work.
Some of the Adafruit libraries seem to be inter-linked; though your posted code doesn't reference the offending .h file, it is possible that one of the Adafruit .h files that are #include do, in turn, reference the missing one.
If so, downloading the Adafruit libraries via the library manager in the IDE should have solved that. How did you download your libraries?
I downloaded them from github. Is it possible for me to delete the github one and download one from the library manager?
I'm no Adafruit user, so I can't help much, just suggesting a possibility. Hopefully, someone here will note this and provide an answer. Certainly, there are plenty of helpers, it just might be a bit of time before one trips over this discussion.
Sorry!
Unfortunately, "mdraber" doesn't ring a bell, so I'm pretty sure he doesn't directly participate here(or frequently, anyway), unless he has a different pseudonym on the forum, which is possible.
Ty camsysca, I think you are correct that it needs the library manager.
Yes, I see both of these in the library manager, so it's quite likely that if you do a load from there, you'll get any dependencies. Good luck!
ty camsysca. I appreciate your help. There are so many adafruit libraries in the library, I dont know what they all do.
Ah, but if you select those two, you should get any dependencies; in my experience, if another library is needed, you'll get prompted for it. Start by downloading the two your code #includes, see if that completes the puzzle. IF not, you should have error messages from the compile process that we can examine.
I have sorted out the library thing. I downloaded the Adafruit Bus Io thing. It compiled. The next thing is that it timed out uploading it to the nano. It says avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x64
I am wondering if I need to list the adresses of the Oled and the ds3231 for the i2c circuit.
Why?
Which processor board do you have?
Which board do you have selected in the IDE?
currently using the nano ( though I have a uno and a mega also ). I have the nano selected in the IDE. I have checked for loose wires but they look OK. Everything compiled but gave the message I posted a minute agao about sync, because it didnt uplaod.
Has the Nano worked before? If not, you may need a port driver.
This
It says avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x64
is indicative of an error communicating with the nano, and has nothing to do with I2C addresses.
It said resp=0x64 which is the hex for an I2C address ( I am guessing ). I recall that the ds3231 defaults at address 0x60. I have a feeling if this problem is corrected it all might work. ( she says :p)
AAh very good point, I have never used it before! Do I need to upload something to it when its new?
Which Nano bootloader?
Clone Nanos need a CH340 driver, different from the genuine Nanos. If you've already done that, you may still need to use the "old Bootloader" option in the IDE. Either of those two problems will result in errors loading the Nano.
Very good point Semperldem ( I do appreciate your help. I havent used this nano before and havent uploaded anything to it before. Is there something it needs to initialize it?
No, which bootloader do you have selected in the IDE?