gg wp

Dependencies:   mbed

main.cpp

Committer:
oZGi
Date:
2018-04-03
Revision:
0:1b0885c2fe42

File content as of revision 0:1b0885c2fe42:

#include "mbed.h"

DigitalOut led(LED2);

DigitalIn ButtoIn(D4);

AnalogOut tri(A2);


int main() {
    led = 0;
    while(1) {
        
       // if(ButtoIn == 0){
//            //led = 1;
////            wait(1);
//
//            tri = tri + 0.1;
//            wait_us(1);
//            if(tri == 1){
//                tri = 0;
//            }
//            wait(0.5);
//            
//        }
//        led = 0;
       
    if(ButtoIn == 1){ 
        tri = tri +0.1;
        wait_us(1);
        if(tri == 1){
            tri = 0;
        }
    }
    
    }
}