MHB BASIC: Blink LED w/ Push Button Using DO...WHILE Loop

  • Thread starter Thread starter ineedhelpnow
  • Start date Start date
  • Tags Tags
    Loop
AI Thread Summary
The discussion centers on using the DO...WHILE...LOOP statement to control an LED's blinking rate at two times per second while a push button is pressed. The program should pause blinking when the button is released and only resume when it is pressed and held again. To implement this, a master DO...LOOP is required to continuously check for button presses, allowing the LED blinking logic to execute within a nested DO...WHILE...LOOP. The complexity of working with APIs for circuit control is acknowledged, highlighting that while simple console operations are straightforward, integrating graphical user interfaces or circuit control can involve extensive coding and various APIs. The specific API for circuit interaction remains unclear to the participants.
ineedhelpnow
Messages
649
Reaction score
0
use the DO...WHILE...LOOP statement to blink an LED at a rate of 2 times a second as long as a push button is pressed. If the push button is not being pressed, the program should wait until the button is pressed and held before blinking the LED. To solve this problem, the DO...WHILE...LOOP will need to be inside of a separate master DO...LOOP that is used to allow our program to continuously repeat itself while waiting for a button press.

please help! i have no idea what to do.
the circuit looks something like this
View attachment 3412
 

Attachments

  • asdfdg.png
    asdfdg.png
    8.5 KB · Views: 116
Technology news on Phys.org
Writing programs that do some computations with numbers or strings and output them to a console ([m]cout[/m] in C++) is the easiest. As soon as we involve APIs (application program interfaces, i.e., libraries that deal with a specific topic), such as those that are used to write graphical user interface or control circuits, things become significantly more complicated. Not only are there different APIs for the same task, but those APIs are often huge and require writing a lot of code even for simple tasks. For example, reading a name from a console and printing "Hello, <name>" can be done in a couple of lines. Writing a program that displays a window with a text box, a button and a label (output area) may take tens of lines.

So, I have no idea which API you are supposed to use to work with circuits.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top