This commit is contained in:
bigalex 2012-10-07 17:16:24 +02:00
parent b2a807e5f2
commit df5dcc5a44

View File

@ -41,7 +41,12 @@ void modeswitch_poll(void) {
}
;
// MODE0 sound detection
/* sound detection mode
* beeps,blinks and moves when sound is detected
* - beep on/off left switch (short)
* - motor on/off right switch (short)
*/
void do_mode0(void) {
static timer_t mytimer;
static uint16_t maxval; //maximum of ADC values read during the las timer interval
@ -111,6 +116,11 @@ void do_mode0(void) {
;
//end do_mode0
/* soundtest mode, just play single tone
* - left buttn: lower frequency
* - right buttn: increase frequency
*/
void do_mode1(void) {
static uint16_t tone;
if (ModeChanged) {
@ -132,6 +142,10 @@ void do_mode1(void) {
}
;
/* crazymoves mode
* - play random sounds and move in random fashion
*/
void do_mode2(void) {
static timer_t mytimer;
uint8_t max = 50;
@ -181,6 +195,10 @@ void do_mode2(void) {
}
;
/* just blink mode
* - left/right button switch motor off/on
*/
void do_mode3(void) {
static timer_t mytimer;
static bool blink;
@ -220,6 +238,11 @@ void do_mode3(void) {
}
;
/* ggrbug mode
* - simulate geiger counter sounds
*/
void do_mode4(void) {
uint8_t max = 200;
uint8_t min = 10;
@ -267,6 +290,11 @@ void do_mode4(void) {
}
;
/* our main method
* things happen right here
*/
void __attribute__((noreturn))
main(void) {
/* hardware initialisation: */