Last active
February 8, 2017 20:05
-
-
Save ateska/d1e142d02ce8aa4c11e200d4af442b44 to your computer and use it in GitHub Desktop.
Hello world for BigClown Core Module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bc_common.h> | |
#include <bc_usb_cdc.h> | |
#include <bc_button.h> | |
static bc_button_t button; | |
void button_event_handler(bc_button_t *self, bc_button_event_t event, void *event_param) | |
{ | |
if (event == BC_BUTTON_EVENT_PRESS) | |
{ | |
char buffer[] = "Hello world!\r\n"; | |
bc_usb_cdc_write(buffer, strlen(buffer)); | |
} | |
} | |
void application_init(void) | |
{ | |
bc_usb_cdc_init(); | |
bc_button_init(&button, BC_GPIO_BUTTON, BC_GPIO_PULL_DOWN, false); | |
bc_button_set_event_handler(&button, button_event_handler, NULL); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment