Last active
August 29, 2015 14:01
-
-
Save gamazeps/b5b634c2f6a2ca8c9bfb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "ch.h" | |
#include "hal.h" | |
int main(void) { | |
halInit(); // Initializes ChibiOS/RT's Hardware Abstraction Layer (HAL) | |
chSysInit(); // Initializes ChibiOS/RT kernel | |
// Configures GPIOD pin 15 as output (the blue LED on the board) | |
palSetPadMode(GPIOD, 15, PAL_MODE_OUTPUT_PUSHPULL); | |
// Main loop, simply blinks the blue led we configured before | |
while(1) { | |
palSetPad(GPIOD, 15); // Sets GPIOD 15 high | |
chThdSleepMilliseconds(500); // Sleep for 500ms | |
palClearPad(GPIOD, 15); // Sets GPIOD 15 low | |
chThdSleepMilliseconds(500); // Sleeps for 500ms | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment