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.
Fork of m3pi by
Revision 10:d0bb2b822af8, committed 2016-01-18
- Comitter:
- richardfirth
- Date:
- Mon Jan 18 05:35:59 2016 +0000
- Parent:
- 9:3053f0dbd8d6
- Commit message:
- with buzzer
Changed in this revision
m3pi.cpp | Show annotated file Show diff for this revision Revisions of this file |
m3pi.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3053f0dbd8d6 -r d0bb2b822af8 m3pi.cpp --- a/m3pi.cpp Sun Jan 17 05:17:48 2016 +0000 +++ b/m3pi.cpp Mon Jan 18 05:35:59 2016 +0000 @@ -77,6 +77,28 @@ motor(1,0.0); } + + +// Richard Added + +int m3pi::playBuzzer (char* tune) { + _ser.putc(DO_PLAY); + _ser.putc(strlen(tune)); + for (int i = 0 ; i < strlen(tune) ; i++) { + _ser.putc(tune[i]); + } + return(0); +} + + +// Richard Added + + + + + + + void m3pi::motor (int motor, float speed) { char opcode = 0x0; if (speed > 0.0) {
diff -r 3053f0dbd8d6 -r d0bb2b822af8 m3pi.h --- a/m3pi.h Sun Jan 17 05:17:48 2016 +0000 +++ b/m3pi.h Mon Jan 18 05:35:59 2016 +0000 @@ -149,6 +149,15 @@ * @returns voltage as a float * */ + + + // Richard Added + + int playBuzzer(char* tune); + + // Richard Added + + float pot_voltage(void); /** Read the battery voltage on the 3pi