led.c
/*******************************************************************************
* examples/led.c *
* ============== *
* *
* Version: 1.0.2 *
* Date : 01.11.17 *
* Author : Peter Weissig *
*******************************************************************************/
//*********************************<Included files>*****************************
#include <tucbot/tucbot.h>
//*********************************<Methods>************************************
void
testLed(
void
);
int
main(
void
);
//*********************************[testLed]***********************************
void
testLed(
void
) {
while
(1) {
leds_set
(
kLedLeft
,
kLedOn
);
leds_set
(
kLedMiddle
,
kLedOff
);
mdelay
(100);
leds_set
(
kLedLeft
,
kLedOff
);
mdelay
(100);
leds_set
(
kLedLeft
,
kLedOn
);
mdelay
(100);
leds_set
(
kLedMiddle
,
kLedOn
);
leds_set
(
kLedLeft
,
kLedOff
);
mdelay
(100);
leds_set
(
kLedRight
,
kLedOn
);
leds_set
(
kLedMiddle
,
kLedOff
);
mdelay
(100);
leds_set
(
kLedRight
,
kLedOff
);
mdelay
(100);
leds_set
(
kLedRight
,
kLedOn
);
mdelay
(100);
leds_set
(
kLedMiddle
,
kLedOn
);
leds_set
(
kLedRight
,
kLedOff
);
mdelay
(100);
}
}
//*********************************[main]***************************************
int
main (
void
) {
init_tucbot
(0xFF);
testLed();
return
(0);
}
leds_set
void leds_set(eLedMask bitmask, uint8_t bool)
Sets the selected leds on or off.
kLedOn
@ kLedOn
constant (0xFF): turn leds on
Definition:
leds.h:63
kLedRight
@ kLedRight
bit mask (0x04): right led
Definition:
leds.h:46
kLedLeft
@ kLedLeft
bit mask (0x10): left led
Definition:
leds.h:42
kLedMiddle
@ kLedMiddle
bit mask (0x08): middle led
Definition:
leds.h:44
kLedOff
@ kLedOff
constant (0x00): turn leds off
Definition:
leds.h:61
init_tucbot
void init_tucbot(uint8_t enable_interrupts)
Initiates the TUC-Bot.
mdelay
void mdelay(uint16_t mseconds)
Waits for the given time in milliseconds.
Generated on Wed Mar 1 2023 09:00:05 for TUC-Bot library by
1.8.17