fw test: Flash in photon mode and improved documentation

This commit is contained in:
Thammi 2013-08-29 21:48:05 +02:00
parent a86a3bb29b
commit 86a97f4873
2 changed files with 11 additions and 5 deletions

View File

@ -7,7 +7,7 @@ The following things exist in all modes:
* right LED is on when IR signals are received (use a remote or first mode to
test)
* pressing the right button activates next mode
* pressing the right button activates next mode, plays a sound using BUZZR
Here is a description what happens on a right button press in which mode:

View File

@ -49,7 +49,7 @@ static void reset_hw(void) {
// 2: SHIELD
// 7: BUZZR
PORTB = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 7);
DDRB = (1 << 2) | (1 << 7);
DDRB = (1 << 2) | (1 << 6) | (1 << 7);
// 0: BUZGND
// 2: LED2
@ -71,6 +71,7 @@ static void reset_hw(void) {
int main(void) {
uint8_t vib_delay = 0;
uint16_t count = 0;
// we need to get real fast (8MHz) to handle 38kHz IR frequency ...
@ -136,9 +137,14 @@ int main(void) {
switch(mode) {
case PHOTONS:
ir_active = button;
follow(button, PORTD, 4);
break;
{
ir_active = button;
if(count % 0x2000 == 0) {
PORTD ^= 1 << 4;
}
++count;
break;
}
case MOTOR:
not_follow(button, PORTB, 6);
break;