Search code examples
arduinostm32stm32f1

How to do Led blink with each port, using stm32 (stm32f103c8t6) boards and Adruino


I am completely new to this and willing to do a simple task using stm32f103c8t6 board, which is "led blink".

Using ArduinoIDE and a simple circuit as shown in the picture, everything goes fine on port PC13. but as soon as I try other ports, it doesn't work. My aim is to be able to toggle the led status using ports PA0 to PA5.

Here is my code:

void setup() {
  // initialize the digital pin as an output.
  pinMode(PC13, OUTPUT);
}

void loop() {
  digitalWrite(PC13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(PC13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

I change PC13 to PA0, and rewire the board, but no luck :(

How can I solve this issue. Any kind of help is highly appreciated.

enter image description here


Solution

  • Sorry for the stupid question. My problem was that I had a broken wire,and when I changed it, everything was working fine.