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: 121
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 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top