Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:1f39a86b8daa
- Child:
- 1:73d739c64e4c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Mar 10 21:22:07 2015 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +#include "stm32f3xx_hal_gpio.h" + +//DigitalOut my_led(LED1); +DigitalOut out_1(D7); +Ticker toggle_ticker; + +void toggle() +{ + HAL_GPIO_TogglePin(GPIOE,GPIO_PIN_14 | GPIO_PIN_15 | GPIO_PIN_13 | GPIO_PIN_12 | GPIO_PIN_11 | GPIO_PIN_10 | GPIO_PIN_9 | GPIO_PIN_8); + //my_led = !my_led; +} + + +int main() +{ + //inicialize power (clock source) to port E (GPIOE) + __GPIOE_CLK_ENABLE(); + + //inicialize pins + GPIO_InitTypeDef GPIO_InitStruct; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; + GPIO_InitStruct.Pin = GPIO_PIN_14 | GPIO_PIN_15 | GPIO_PIN_13 | GPIO_PIN_12 | GPIO_PIN_11 | GPIO_PIN_10 | GPIO_PIN_9 | GPIO_PIN_8; + HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); + + // Init the ticker with the address of the function (toggle) to be attached and the interval (100 ms) + + toggle_ticker.attach(&toggle, 0.1); + while (1) { + } +}