Trung Nguyen
/
FINAL_PROJECT_4180
asdasdasd
Fork of FINAL_PROJECT_4180 by
Diff: lib.cpp
- Revision:
- 7:800afb8c4cb5
- Parent:
- 6:d0582711a5d1
- Child:
- 8:9b41712fd2c3
--- a/lib.cpp Mon Apr 25 00:57:50 2016 +0000 +++ b/lib.cpp Mon Apr 25 01:03:46 2016 +0000 @@ -162,4 +162,12 @@ char temp = android->getc(); if (temp == SUCCESS) return true; else return false; -} \ No newline at end of file +} + +void buzzer(PwmOut *speaker, int seconds) +{ + speaker->period(1.0/500.0); + *speaker = 0.5; + wait(seconds); + *speaker = 0.0; +}