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: SDFileSystem emic2 mbed-rtos mbed
Fork of BAT_senior_design_Testnew by
functions.cpp
- Committer:
- aismail1997
- Date:
- 2017-10-13
- Revision:
- 8:1aa86ad19af9
- Child:
- 11:418a4437a693
File content as of revision 8:1aa86ad19af9:
#include "wave_player.h"
#include "SDFileSystem.h"
void moveServoIn(PwmOut servo, DigitalIn pb)
{
while(pb == 1)
//myled = 1;
// rotate 90 degrees one way
for(int i=3; i<=7; i++) {
servo = i/100.0;
wait(0.01);
}
}
void moveServoOut(PwmOut servo, DigitalIn pb)
{
while(pb == 1)
//myled = 0;
for(int i=7; i>3; i--) {
servo = i/100.0;
wait(0.01);
}
}
void playSound(wave_player waver)
{
FILE *wave_file;
wave_file=fopen("/sd/police_siren.wav","r");
waver.play(wave_file);
fclose(wave_file);
}
