Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Arduino Mega not executing my sketch

2 posters

Go down  Message [Page 1 of 1]

1Arduino Mega not executing my sketch Empty Arduino Mega not executing my sketch Sat Jun 19, 2021 11:56 pm

sven-e



I have a sketch that works fine with an Arduino Nano. But when I replace it with an Arduino Mega then I get no indication that the sketch is running.
To prove something is running I set the pin 13 (LED_BUILTIN) to HIGH. The built-in LED on the Mega board does not light up. (It does for the Nano.) I also put a probe on pin 13 and it shows 0 V for the Mega. (Shows 5 V for the Nano.)

I put a probe on the 5V pin and yes, it does show 5 V so something is working.

I also tried to debug my sketch. It single steps through the code in setup() without problem but without any change to pin 13 or the built-in LED.

Another strange thing is that the debugger fails on delay() and jumps to the start of the setup() function.

I am running SimulIDE 0.4.14-SR4

Thanks for help.
 / Sven

2Arduino Mega not executing my sketch Empty Re: Arduino Mega not executing my sketch Sun Jun 20, 2021 2:06 am

arcachofo

arcachofo

Hi.

Did you select "Mega" board when compiling?

And... can you share your sketch so I can test?

sven-e likes this post

3Arduino Mega not executing my sketch Empty Re: Arduino Mega not executing my sketch Sun Jun 20, 2021 9:58 am

sven-e



Thanks for quick reply.
Found that setting for board now and got the sketch working. Thanks for that.

I would suggest an improvement to the UI so that there is a properties icon in the toolbar for the editor. The popup-menu isn't easy to find and isn't the first place the user looks at. Adding an icon in the tool bar makes this more visible and easier to find.

Alternatively, use the board that is included in the schema automatically.

And thanks for your work on SimulIde. I really like it compared to other simulators I tried.

/ Sven

4Arduino Mega not executing my sketch Empty Re: Arduino Mega not executing my sketch Sun Jun 20, 2021 1:05 pm

arcachofo

arcachofo

I would suggest an improvement to the UI so that there is a properties icon in the toolbar for the editor. The popup-menu isn't easy to find and isn't the first place the user looks at. Adding an icon in the tool bar makes this more visible and easier to find.
Yes, you are right.
This is planned but not implemented yet.

Alternatively, use the board that is included in the schema automatically.
In next versions several Arduinos can be in the circuit, or you might use an atmega 328 instead of an Arduino board, so automatic detection might not work.

sven-e likes this post

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum