Abhiyanta-Community / Hardware-and-Timer-Interrupt-with-ATmega328p-Hardware

0 stars 0 forks source link

Interfacing Push Button and LEDs #2

Closed PRITVARMORA closed 2 years ago

PRITVARMORA commented 2 years ago

Interface a push-button and five LEDs in such a way that when push button gets pressed at every 100 millisec the next LED gets turned on and the previous LED gets turned off and thus in 1sec all five LEDs blinks one by one. (Hint: Make separate user-defined functions for monitoring push button and controlling LEDs)

You need to control LED without using pinMode or Digital write (any built-in) function. (Hint: control LEDs using port registers)

vasoyasujal42 commented 2 years ago

@PRITVARMORA delay(0.001); if I not use this when press push button one time loop will rotate two times or three time and many times more rotating. if I use this code run fine.

vasoyasujal42 commented 2 years ago

also check the code commits section

PRITVARMORA commented 2 years ago

@vasoyasujal42 search about flickering problem with mechanical push button You will find your solution.

vasoyasujal42 commented 2 years ago

@PRITVARMORA I all ready change it two times.

PRITVARMORA commented 2 years ago

@PRITVARMORA I all ready change it two times.

@vasoyasujal42 Changing it is not the solution you need to search in depth about this issue and how to resolve it.

PRITVARMORA commented 2 years ago

@vasoyasujal42 Also check The issue of floating pin while switch disabled or un-pressed, Also look at the solution for it, It will defiantly resolve the issue

PRITVARMORA commented 2 years ago

-->In this task we made 9 led on-off in sequence with push ...

Write the conclusion properly using the same instructions I have explained for documentation (for example technical report must be written as indirect method of language), In this Conclusion I haven't found any technical details I have asked you to include, like ways of solving flickering push button and floating pin problem. You have also not included the hyper link to the conclusion as I have asked you to note down.

Regards, Prit Varmora

vasoyasujal42 commented 2 years ago

==>Conclusion -->In this task we made 9 led on-off in sequence with push button. we started from led on with register (96b0f0a18c2cb600588b0752677301de47c6bede). After this we started make to run leds in sequence (40a62efde4e16e605cfa0e19d254b01864b8e229) then after started add push button with this and add coding part for this (d7b02dec10b840e96658935673421e857fe74483) but face many issues many times either software and hardware both many times loos connections happening many time compiler error. Major issues that flickering , floating pin , coding logical error. -->Flickering A poor connection between the light or fixture switch and the bulb can cause flickering. Try gently wiggling the switch to see if this causes a flicker. If it does, you've found the problem. If your light is already flickering, try toggling the switch on and off and see if this fixes the problem. In this issue led continues rotating 2 or 3 times when we push the button because of push button flickering. Due to flickering microcontroller take this spikes more than 1 time and problem will occur. solution for flickering = hardware, software, circuit.

-->Floating pin A signal is said to be “floating” when its state is indeterminate, meaning that it is neither connected to VCC or to ground. The signal's voltage will “float” to match the residual voltage. The term “floating” is often used interchangeably to describe a pin which is in the high-impedance state. In this issue led continues rotating 2 or 3 times when we push the button
because of floating pin some time automatically leds start rotating. solution for flickering = Use external pull-up resistor or internal pull-up register we talk on this in future here. -->After this we start we working on internal register we face many difficulty for set this after many compilation error and many time debugging the code we finally did it(de6a33979a07a16182e6d3add37070cb579c4461). -->In the last code is complete but its some long then we working on reducing the code (bd830e9adffead598896585fe98728073992accd).
-->In the end of ask we learn may things like how to control internal pull-up register and use this for projects and also we learn what is flickering. Also how to tackle with problems.

beladiyachintan commented 2 years ago

<===> Conclusion <===>

~~>This task we made 9 led on-off in sequence with a push button. we started from LED on with register and We face compiler error, floating pin, flickering, code logical error.

~~>Flickering Flickering issue is led continues rotating more than 2 times when we push the button because of push button flickering. Due to flickering, microcontroller take this spikes more than 1 time and problem will occur. Solution for flickering is hardware, software and circuit.

~~>Floating pin Floating means logic not zero(0) and one(1) value is in between(like 2.5). In this issue LED continues rotating more than 2 times when we push the button because of floating pin sometime automatically LED start rotating. Solution for flickering is use pull-up register.

~~>After this, we start working on pull up register though we face many difficulties for setting this in code but in the end, we gained the success also.

~~>End of this task, we learn about why we use and how we use pullup resistors and learning what is flickering and how this problem solve.

Darshnik253 commented 2 years ago

Conclusion:-

After completion of this task, i learnt about simulation software, arduino code in embedded c. And also understand logic of task. After completion of task, i understood how practically datasheet is helpfull for doing project and making things more clear. To do simulation of task i face many problems to generating ideal result, like on a first time it was not running because first code is not as per task after changing the code i face if i close Arduino IDE then it was giving fatal for not finding hex file so i resolve this issue and so on. After completion of this i understand how to resolve practical problem of project or task.