#include //STM32F407 DISCOVERY KIT BLINKING LEDS char LEDS[10]={PC7,PC9,PA9,PA13,PA15,PC11,PD0,PD2,PD4,PD6}; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. for(int i=0;i<10;i++) { pinMode(LEDS[i],OUTPUT);} pinMode(PB7,INPUT); } // the loop function runs over and over again forever void loop() { if (digitalRead(PB7)==0) { for(int i=0;i<10;i++) {digitalWrite(LEDS[i], HIGH); // turn the LED on (HIGH is the voltage level) delay(10); // wait for a 0.05 second digitalWrite(LEDS[i], LOW); // turn the LED off by making the voltage LOW delay(10);} // wait for a 0.05 second } else { for(int i=9;i>=0;i--) {digitalWrite(LEDS[i], HIGH); // turn the LED on (HIGH is the voltage level) delay(10); // wait for a 0.05 second digitalWrite(LEDS[i], LOW); // turn the LED off by making the voltage LOW delay(10);} // wait for a 0.05 second } }