joric / cc2540-keyboard

CC2540 firmware for the tiniest mechanical keyboard ever
60 stars 11 forks source link

Trying to turn on a led without using ble #2

Closed onesimo93 closed 4 years ago

onesimo93 commented 4 years ago

I want to use the cc2540 but I don't know how to write code for this as the OSAL layers make it way more difficult than anything I have tried before.

Can you help me?

joric commented 4 years ago

Haven't tried honestly. Probably BLE-CC254x-1.4.2.2\Projects\ble helps, all the HalLedSet stuff.

// makes sure LEDs are off
HalLedSet( (HAL_LED_1 | HAL_LED_2), HAL_LED_MODE_OFF );
for (i=0; i<12000; i++) asm("NOP"); //1.5ms delay

To change LED's change the following in hal_board_cfg.h:

#define LED1_BV BV(4)
#define LED1_SBIT P1_4