ff snel plz
Dependencies: FastPWM MODSERIAL mbed
Fork of Week3_Assignment1 by
main.cpp
- Committer:
- EvaKrolis
- Date:
- 2018-09-21
- Revision:
- 2:4b07b20b8476
- Parent:
- 0:1ce2f25401f0
- Child:
- 3:f9ac37cdfa50
File content as of revision 2:4b07b20b8476:
#include "mbed.h" #include "FastPWM.h" FastPWM led1(D9); int frequency_pwm = 10000; InterruptIn button1(D1); InterruptIn button2(D2); void brightness() { if (button1 == 1) { led1.write(1); } } int main() { led1.period(1.0/frequency_pwm); //button1.rise(brightness); while (true) { led1.write(0.01); button1.rise(brightness); } }