Go Down

Topic: Sketch won't run (Read 445 times) previous topic - next topic

avalon66

I have put this project together, and as you may see I have a half size pcb board strapped to a full sized bread board, and I've soldered a few male header pins, resistors and buttons to the pcb board.

I have checked that power is getting to each device which is attached , and there isi full continuity between various points on pcb board and breadboard.
The DS3107RTC is working and returns an address when I used the I2C scanner, and the display lights up when a 5volt 2.5 amp power supply is connected.

After I uploaded the sketch and powered up, only the display came on but no sketch running.

The code and a picture of the setup attached

groundFungus

In your picture of the setup, it looks like the humidity sensor power is connected backwards.

UKHeliBob

Quote
but no sketch running.
If the upload was successful then the sketch will be running

Put some Serial.print()s in the code at strategic points such as entry to and return from functions and print out the value of pertinent variables.  Is the code calling the functions that you expect and are the values of variables sensible ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

avalon66

In your picture of the setup, it looks like the humidity sensor power is connected backwards.
Yes it was, and I noticed that fater I took the picture, but it is the right round now.

The display is supposed to scroll the date and time along with temperature and humidityL

https://arduino-projects-free.blogspot.com/2018/06/max7219-rtc-ds1307-dht11-led-matrix.html

avalon66

If the upload was successful then the sketch will be running

Put some Serial.print()s in the code at strategic points such as entry to and return from functions and print out the value of pertinent variables.  Is the code calling the functions that you expect and are the values of variables sensible ?
Thanks, but first off , it is not my code but from here:

https://arduino-projects-free.blogspot.com/2018/06/max7219-rtc-ds1307-dht11-led-matrix.html

I tried this:

RTC.readTime();
  sprintf(psz, "%02d", RTC.s);
  Serial.print("Time");

But it didn't work, so I must have got it in the wrong place.

So I tried it here, but nothing printed out:
RTC.readTime();
  sprintf(psz, "%c%02d%c%02d", (f ? ':' : ' '), RTC.h, (f ? ':' : ' '), RTC.m);
  Serial.print("Time");

If you could point me to the right place please.

UKHeliBob

Quote
But it didn't work
Did you add a Serial.begin() to setup() ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

avalon66

After I disconnected the DHT sensor and buttons from the Arduino, I uploaded the MD_Parola,/ Parola_Scrolling, but that does not show anything on the display.

And in a serial monitor it shows:
17:30:50.011 -> ⸮⸮⸮⸮⸮⸮0⸮i8E2#

This is at the top of the sketch

#if DEBUG
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }
#define PRINTS(x) Serial.print(F(x))
#define PRINTX(x) Serial.println(x, HEX)
#else


avalon66

#7
Apr 16, 2019, 07:32 pm Last Edit: Apr 16, 2019, 07:37 pm by avalon66
Did you add a Serial.begin() to setup() ?
No I didn't as I didn't know I had to do that.
I've just added Serial.begin() now  in the void setup(void) section, but the sketch won't compile.

avalon66

#8
Apr 16, 2019, 08:46 pm Last Edit: Apr 16, 2019, 09:09 pm by avalon66
I have uploaded the Parolla_Scrolling sketch, and have just the display attached to the  arduino.

In a serial monitor this printed:
19:43:26.839 -> ⸮
19:43:28.443 -> [Parola Scrolling Display]
19:43:28.443 -> Type a message for the scrolling display
19:43:28.443 -> End message line with a newline

There is nothing on the display, except that it is lit up

So as someone said earlier the sketch is running but the display does not show anything

UKHeliBob

Quote
I've just added Serial.begin() now  in the void setup(void) section, but the sketch won't compile.
What baud rate did you specify in the the begin() function ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

avalon66

What baud rate did you specify in the the begin() function ?
It was 57600 as specified in the said sketch

UKHeliBob

It was 57600 as specified in the said sketch
Which sketch is that ?

What error did you get ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

avalon66

Which sketch is that ?

What error did you get ?
It was the Parolla Scrolling sketch, and there was nothing on the display, as it went off.
As soon as I plug in the usb lead to the arduino, the display lights up then goes off! Is it faulty or what as I have only had it for about a week and have not been able to get the sketch to run, even tho' it lights up.

avalon66

I have uploaded the sketch and wiring diagram.

The sketch is over 600 lines so I can't put it between code tags.

UKHeliBob

I see that there is no Serial.begin() in the sketch nor any debugging Serial.print()s

What did you try ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Go Up