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: 117
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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top