Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed TTU_CSC1300
main.cpp
- Committer:
- kingcolba
- Date:
- 2021-04-09
- Revision:
- 0:2795fb9c6557
File content as of revision 0:2795fb9c6557:
/* * Lab #: 3 * Lab Title: Reading and Processing Analog Inputs * Author(s): Colby Adams * Date: 5 April 2021 * Purpose: Conditional Statements */ #include "mbed.h" #include "TTU_CSC1300.h" //FUNCTION PROTOTYPES GO HERE TextLCD lcd(TextLCD::LCD_CURSOR_ON_BLINKING_ON); int main(){ //this while(TRUE) loop keeps the program running while(TRUE){ float f_value = pot.read(); //f_value > 0.0f && f_value < 1.0f float timer = (f_value * 25) + 20; if ((sw5 == true && timer > 35) || sw4 == true){ if (led0 == false){ speaker = true; led0 = true; } else if (led0 == true){ led0 = false; speaker = true; } } else { if (speaker == true){ speaker = false; } else if (speaker == false){ speaker = true; } } } }