Jerrald Limbaugh / Mbed 2 deprecated Lab2

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;
    }
}