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: MODSERIAL mbed FastPWM
main.cpp
- Committer:
- EvaKrolis
- Date:
- 2018-09-21
- Revision:
- 2:4b07b20b8476
- Parent:
- 0:1ce2f25401f0
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);
}
}