Other Parts Discussed in Thread: CC2650
Tool/software: Code Composer Studio
please help me to write a source code for blinking a LED in css using cc2650
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Other Parts Discussed in Thread: CC2650
Tool/software: Code Composer Studio
please help me to write a source code for blinking a LED in css using cc2650
hi,
you can take look at this pdf..
BLINKING AN LED:
while(TRUE)
{
PIN_setOutputValue(hPin,Board_LED0,IOID_10);
Task_sleep (delaybyDurationUs / Clock_tickPeriod);
PIN_setOutputValue(hPin,Board_LED0,IOID_0);
Task_sleep (delaybyDurationUs / Clock_tickPeriod);
PIN_setOutputValue(hPin,Board_LED1,IOID_15);
Task_sleep (delaybyDurationUs / Clock_tickPeriod);
PIN_setOutputValue(hPin,Board_LED1,IOID_0);
Task_sleep (delaybyDurationUs / Clock_tickPeriod);
}
}
Various sounds at buzzer:
#define Buzz IOID_21
PIN_Config LedPinTable[] =
{
Buzz | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Board_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
PIN_TERMINATE
};
static void taskFxn(UArg a0, UArg a1)
{
PIN_State pinState;
PIN_Handle hPin;
uint32_t delaybyDurationUs = 5000000;
hPin = PIN_open(&pinState, LedPinTable);
while(TRUE)
{
PIN_setOutputValue(hPin,Buzz,Buzz);
Task_sleep(10);
PIN_setOutputValue(hPin,Buzz,0);
Task_sleep(10);
}
}