Text: Draw a flowchart for the Design portion: while loop,
conditional IF statements. There are 2 input devices and 2 output
devices. Input devices include button and light sensor. Output
devices include LED light and LCD screen.
Thank you in advance.
In all cases, we will:
- Practice calling functions and implementing statements and expressions in Python.
- Practice implementing conditional flow control through an IF statement.
- Practice implementing simple looping via the WHILE loop.
By the end of this lab, you should be able to:
- Describe the aspects and importance of looping vs conditional flow control in programming.
- Implement looping within a Python script for a given problem.
Preparation:
Record your pre-lab work as part of your logbook entry.
1. Design:
Referencing lecture material if needed, draw a flowchart that represents a design for the problem that best fits the devices chosen for Lab 3. The problem can be summarized as follows:
- In a continuous loop:
- Read the input analog device.
- Convert the input analog reading to an output percentage.
- Print the output percentage.
- If the digital input (button) is NOT pressed:
- If the reading is above a given threshold value, manipulate the alarm output device to show "alarm criteria" met.
- Else, turn off the alarm.
- Wait a predetermined amount of time.