circleelectronic
Published

How to make Knight Rider with STM32F411 on Mbed

Learn to code Knight Rider with STM32 and Circle Electronic Knight Rider kit

BeginnerProtip235
How to make Knight Rider with STM32F411 on Mbed

Things used in this project

Hardware components

Circle Electronic Knight Rider
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
STM32 Nucleo-64 Board
STMicroelectronics STM32 Nucleo-64 Board
×1

Story

Read more

Code

Codes

C/C++
#include "mbed.h"

BusOut leds(PC_8,PC_6,PC_5,PA_12,PA_11,PB_12,PB_2,PB_1);

int ms=100;

int main(){
    while(1){
        for(int i=0; i<=7; i++){
            leds[i]=1;
            wait_ms(ms);
            leds[i]=0;
            }
             for(int i=7; i>=0; i--){
            leds[i]=1;
            wait_ms(ms);
            leds[i]=0;
            }
        }
    }

Credits

circleelectronic
0 projects • 4 followers
Contact

Comments

Please log in or sign up to comment.