STM8S003K3 BLINKING IN ARDUINO

Photo of author

By Jackson Taylor

#define LED_GPIO_PORT  (GPIOD)
                     #define LED_GPIO_PINS  (GPIO_PIN_7 | GPIO_PIN_2 | GPIO_PIN_1 | GPIO_PIN_0)
                     #define led PD7
                     void setup() {
                      GPIO_Init(GPIOD, (GPIO_Pin_TypeDef)LED_GPIO_PINS, GPIO_MODE_OUT_PP_LOW_FAST);
                       pinMode(led, OUTPUT);
                     }
                     // the loop function runs over and over again forever
                     void loop()
                     {
                       GPIO_WriteReverse(LED_GPIO_PORT, (GPIO_Pin_TypeDef)LED_GPIO_PINS);
                       delay(1000);
                       // wait for a second
                     }
See also
LCD ARDUINO