I need help with my project.

Hi
I am using my arduino uno to control 128x64 display and i have an issue.My sketch runs exactly like i want i to but after about 20 seconds od operating arduino restarts. I tried to find cause of this problem but I’m helpless. Could someone possibly help me? I can show my code if you need it.

ekran2.ino (10.9 KB)

A schematic of how you have the whole system hooked up and what power you are using for the system would sure help.

Have you used the "Serial.write" and Serial.println" to identify the last thing to be executed before the Arduino restarts? That would give you a clue about the source of the problem.

Paul

A possible cause of your problem is memory corruption - perhaps caused by writing past the end of an array or the incorrect use of malloc()

I have no idea what goes on inside the Adafruit display library and (for obvious reasons) you are using it a lot.

Maybe take several of your functions out of the code and see if the problem goes away. And then add them back one at a time.

...R

Hi,

How are you powering your project?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :)

What other hardware is used besides arduino and display? Was it an UNO, MEGA, etc.?

When you post code, make sure you explain what you want the code to do in theory and what you see it actually doing. No one appreciates having to guess what your code does.

Ok I think i got this working.I used Serial.println to check what's causing the restart but when I uploaded the new sketch it program started to work great. I didn't change anything in the code except "Serial.print".Then I deleted Serial.print command and it's working fine now. I don't think this was a problem with my USB ports because i've tried it on every one of them.Anyway, thanks to everyone of you for trying to help me.

konrad161:
Ok I think i got this working.I used Serial.println to check what’s causing the restart but when I uploaded the new sketch it program started to work great. I didn’t change anything in the code except “Serial.print”.Then I deleted Serial.print command and it’s working fine now. I don’t think this was a problem with my USB ports because i’ve tried it on every one of them.Anyway, thanks to everyone of you for trying to help me.

The old restart gremlin at work again. He is just sleeping and will wait for an opportunity to wake up, again.

Paul

Well, for now, the OP's spirit is high, which is a good thing. Even if the same gremlin comes back at a later time, the OP will be more experienced and more likely to catch it and give it some proper beating.

liudr: the OP will be more experienced and more likely to catch it

Except that gremlins have a habit of coming back in a different form each time: similar but not exactly the same symptoms under similar but not exactly the same circumstances and the previous solution is then not quite applicable.

Especially if she hears anyone saying stuff like "more likely to catch it and give it some proper beating".

I think that this Gremlin just woke up. It' restarting again :(. I made a schematic in fritzing of how i have it hooked up. This program displays 3 things on the screen : outside temperature which is provided from thermistor , which gear is on for now is from three buttons and a engine temperature sensor made from a potentiometer.

I see no ground connection between the uno and your breadboard on your fritzing.

I forgot about it in fritzing but it's connected.

Bump

Hi Konrad,

The logo on your Fritzy picture* says it’s a seeed. You are using Adafruit code. Most of the code from the Adafruit library is fine, but there is a user editable part in Adafruit_SSD1306.h that sets the address andpixel dimensions for the display. Look at that part and make sure it matches your seeed display.

*You should update your Fritzy picture to indicate the correction you made a couple posts up - folks aren’t responding because you are making work for them by continuing to display your incorrect diagram (I mean it’s bad enough that you are using the despised Fritzy format … :wink: ) Fix your diagram so it correctly shows what you have. (And if you just added the ground, say so and continue. np.)

The logo on t