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:
- jzlimbaugh
- Date:
- 2020-11-12
- Revision:
- 1:52c4dc3237b5
- Parent:
- 0:268a8b67fdbe
File content as of revision 1:52c4dc3237b5:
/*
* Lab #:2
* Lab Title:Reading and Processing Analog Inputs
* Author(s):Jerrald Limbaugh
* Date:November 11th
* Purpose:Turn on Led and Buzzer then wait turn them off then wail according to the resistance of the Potentiometer.
*/
#include "mbed.h"
#include "TTU_CSC1300.h"
//FUNCTION PROTOTYPES GO HERE
int main()
{
while(TRUE)
{
float f_value = pot.read();
float wait = f_value * 25 + 20;
led0 = TRUE;
speaker = TRUE;
wait_ms(10);
speaker = FALSE;
led0 = FALSE;
wait_ms(wait);
led0 = TRUE;
speaker = TRUE;
}
}