Skip to content

Instantly share code, notes, and snippets.

@ateska
Last active February 8, 2017 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ateska/d1e142d02ce8aa4c11e200d4af442b44 to your computer and use it in GitHub Desktop.
Save ateska/d1e142d02ce8aa4c11e200d4af442b44 to your computer and use it in GitHub Desktop.
Hello world for BigClown Core Module.
#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