#include <tucbot/tucbot.h>
void testCyclic_beds(void);
void testCyclic_beeper(void);
void testCyclic(void);
int main(void);
void testCyclic_leds(void) {
static uint8_t state = 0;
state = !state;
}
void testCyclic_beeper(void) {
static uint8_t nr = 0;
static uint16_t frequ;
#define MUSIC_NOTE_A_L 440
#define MUSIC_NOTE_H_L 494
#define MUSIC_NOTE_C 523
#define MUSIC_NOTE_D 587
#define MUSIC_NOTE_E 659
#define MUSIC_NOTE_F 698
#define MUSIC_NOTE_G 783
#define MUSIC_NOTE_A 880
#define MUSIC_NOTE_H 988
#define MUSIC_NOTE_C_1 1047
#define MUSIC_NOTE_D_1 1175
#define MUSIC_NOTE_E_1 1319
#define MUSIC_NOTE_F_1 1397
#define MUSIC_NOTE_G_1 1568
#define MUSIC_NOTE_A_1 1760
#define MUSIC_NOTE_H_1 1976
frequ = 0;
nr++;
if (nr >= 160) {nr = 0;}
if (nr > 128) {
return;
}
if (nr < 65) {
switch (nr & 31) {
case 1: frequ = MUSIC_NOTE_E_1; break;
case 3: frequ = MUSIC_NOTE_E_1; break;
case 5: frequ = MUSIC_NOTE_F_1; break;
case 7: frequ = MUSIC_NOTE_G_1; break;
case 9: frequ = MUSIC_NOTE_G_1; break;
case 11: frequ = MUSIC_NOTE_F_1; break;
case 13: frequ = MUSIC_NOTE_E_1; break;
case 15: frequ = MUSIC_NOTE_D_1; break;
case 17: frequ = MUSIC_NOTE_C_1; break;
case 19: frequ = MUSIC_NOTE_C_1; break;
case 21: frequ = MUSIC_NOTE_D_1; break;
case 23: frequ = MUSIC_NOTE_E_1; break;
case 26: frequ = MUSIC_NOTE_E_1; break;
case 27: frequ = MUSIC_NOTE_D_1; break;
case 31: frequ = MUSIC_NOTE_D_1; break;
}
} else {
switch (nr) {
case 65: frequ = MUSIC_NOTE_D_1; break;
case 67: frequ = MUSIC_NOTE_D_1; break;
case 69: frequ = MUSIC_NOTE_E_1; break;
case 71: frequ = MUSIC_NOTE_C_1; break;
case 73: frequ = MUSIC_NOTE_D_1; break;
case 74: frequ = MUSIC_NOTE_E_1; break;
case 75: frequ = MUSIC_NOTE_F_1; break;
case 77: frequ = MUSIC_NOTE_E_1; break;
case 79: frequ = MUSIC_NOTE_C_1; break;
case 81: frequ = MUSIC_NOTE_D_1; break;
case 82: frequ = MUSIC_NOTE_E_1; break;
case 83: frequ = MUSIC_NOTE_F_1; break;
case 85: frequ = MUSIC_NOTE_E_1; break;
case 87: frequ = MUSIC_NOTE_F_1; break;
case 89: frequ = MUSIC_NOTE_C_1; break;
case 91: frequ = MUSIC_NOTE_D_1; break;
case 93: frequ = MUSIC_NOTE_G ; break;
case 95: frequ = MUSIC_NOTE_E_1; break;
case 97: frequ = MUSIC_NOTE_E_1; break;
case 99: frequ = MUSIC_NOTE_E_1; break;
case 101: frequ = MUSIC_NOTE_F_1; break;
case 103: frequ = MUSIC_NOTE_G_1; break;
case 105: frequ = MUSIC_NOTE_G_1; break;
case 107: frequ = MUSIC_NOTE_F_1; break;
case 109: frequ = MUSIC_NOTE_E_1; break;
case 111: frequ = MUSIC_NOTE_D_1; break;
case 113: frequ = MUSIC_NOTE_C_1; break;
case 115: frequ = MUSIC_NOTE_C_1; break;
case 117: frequ = MUSIC_NOTE_D_1; break;
case 119: frequ = MUSIC_NOTE_E_1; break;
case 121: frequ = MUSIC_NOTE_D_1; break;
case 124: frequ = MUSIC_NOTE_C_1; break;
case 125: frequ = MUSIC_NOTE_C_1; break;
}
}
if ( frequ ) {
}
}
void testCyclic(void) {
uint8_t pos = 0;
static uint8_t id = 0;
while (1) {
if (id == 0) {
} else {
id = 0;
}
}
if (pos < 15) {
pos++;
} else {
pos = 0;
}
}
}
int main (void) {
testCyclic();
return (0);
}