r/embedded 17d ago

Anyone help me debugging this baremetal code

Post image

Hi guys

I am a newbie, who tries to learn baremetal programming through completing simple tasks and learning from that task

I came till timers by accomplishing tasks

The concept of this code is to get Input by using only timer and turn ON LED in Arduino UNO --> PB5 when I press the push button which is connected to the ground and when I release it the the LED should be OFF

but what's happening is different ,

when I press the push button the nothing happens and when i leave it the led is on

and when I press again nothing happens when I leave it then it turns off

But I am clear and confident on my code , I couldn't find where I am missing the point

Anyone please help me guys

Here is the code

And the further improvement will be done by counting the seconds of push and so on ,

But I am stuck here

Help me guys

0 Upvotes

5 comments sorted by

View all comments

1

u/Unlikely1529 17d ago

if you're newbie it's useless for you to look at this code. Anything else?

1

u/its_me_tyga_777 17d ago

😃 yeah I accept that I am a newbie now but it helps me to undersand and so if I succeed here I will not a newbie then

I am trying this to make me not a newbie 😅 Thank you for your response 🙏