STM32F103 Digital Input (using Med.h)

Introduction: STM32F103 Digital Input (using Med.h)

In this tutorial, we will learn about reading digital input from GPIO Pins in STM32F103 Nucloe Board using mebd.h.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Coding and Compiling

Creating Project

Now, open the compiler on mbed developer website. Click on "NEW" to create a new project. Set Platform to 'NUCLEO-F103RB'. From the template select 'Read the board user button state'. Enter a program name. Click 'ok'. Open 'main.cpp' if not already open.

And here is the code you will need to read that blue push button on your nucleo board and control that LED on you nucleo using this button. This code is very similar to one explained in "Getting started (using mbed) tutorial".


Compile this code by clicking on compile button. Download this onto your Nucleo Board. Or if downloaded somewhere else drag from there and drop onto Nucleo Directory in your 'This PC'/'My Computer'. This will flash this code onto your STM32 Nucleo Board.

Now, Push that blue button on your board and see what happen to LED! :)

Be the First to Share


    • Finish It Already Speed Challenge

      Finish It Already Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020
    • First Time Author Contest

      First Time Author Contest

    2 Discussions


    4 years ago

    i cant see the code.


    Reply 4 years ago

    oh now i get it