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.
main.cpp
- Committer:
- Magnus_tl
- Date:
- 2017-07-31
- Revision:
- 0:9b09ea979c72
- Child:
- 1:5d1abf5d24a5
File content as of revision 0:9b09ea979c72:
#include "mbed.h"
DigitalOut myled(LED1);
DigitalIn Pedel(PA_0);
AnalogIn Pot(PA_7);
DigitalOut Relay(PB_0);
int main() {
Relay = 1 ;
float Time = 0 ;
while(1) {
/* myled = 1; // LED is ON
wait(0.2); // 200 ms
myled = 0; // LED is OFF
wait(1.0); // 1 sec
*/
if (Pedel == 0) // Kontrol af pedal tryk
{
// Time = Pot;
Relay = 0;
myled = 1; // LED is ON
wait(Time);
}
else
myled = 0; // LED is OFF
Relay = 1;
}
}
