lab 2 part 4

Dependencies:   mbed

Fork of lab2_part4 by Rebecca Greenberg

main.cpp

Committer:
m162568
Date:
2014-09-03
Revision:
0:7e7206bbc34c

File content as of revision 0:7e7206bbc34c:

#include "mbed.h"

Serial pc(USBTX, USBRX);

int main() {
    float brightness;   //initializes variable
    pc.baud(921600);    //set the baud rate to 921600
    PwmOut light(LED1); // creates a PWMout named light on LED1. 
                        // will be able to change the brightness of the light using the PWM
    printf("Type the desired brightness from 0.0 t o 1.0\n"); //prompts the user
    scanf("%f",&brightness);                                  //reads in value typed.
    printf("%f is the brightness", brightness);              
    light.write(brightness);                 //sets the value of light to variable brightness
    
    
    }