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.
Beeper.h
00001 #include "mbed.h" 00002 00003 #ifndef __BEEPER_H__ 00004 #define __BEEPER_H__ 00005 class Beeper 00006 { 00007 public: 00008 static void beep(int freq, int duration); 00009 static void noise(int freq, int duration); 00010 00011 private: 00012 static uint16_t lfsr_rand() 00013 { 00014 static uint16_t lfsr = 0xACE1u; 00015 lfsr = (lfsr >> 1) ^ (-(lfsr & 1u) & 0xB400u); 00016 return lfsr; 00017 } 00018 00019 private: 00020 static DigitalOut _speaker; 00021 }; 00022 #endif //__BEEPER_H__
Generated on Tue Jul 12 2022 21:15:25 by
