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: mbed
main.cpp
- Committer:
- remiwan
- Date:
- 2022-06-09
- Revision:
- 0:cc4683d537a7
File content as of revision 0:cc4683d537a7:
#include <mbed.h>
//Jumper
DigitalIn jumper(PA_2, PullDown);
//Moteur balle
DigitalOut INAB(PC_3);
DigitalOut INBB(PH_1);
PwmOut PWMB(PB_0);
bool start = false;
void init_moteur_balle(void);
int main()
{
init_moteur_balle();
while(1)
{
if(jumper==1)
{
INAB = 0;
INBB = 1;
PWMB.write(0.2);
}
else
{
INAB = 0;
INBB = 1;
PWMB.write(0);
}
}
}
void init_moteur_balle(void)
{
INAB = 0;
INBB = 0;
PWMB.period(0.00005); // 20 kHz (valid 0 - 20 kHz)
PWMB.write(0);
}