See notes 5 and 6 in the Pinouts and pin description of the datasheet.Īlso note that Arduino pin 17 returned NO pin associated with it on the blue pill, and blue pill pin B12 is absent from the listing.Īrduino SAM boards, SAMD boards (I am planning to use these in the future), STM32F1xx/GD32F1xx, STM32 cores. The pattern set by the sketch is reversed. Note that according to the datasheet, pin C13 (PC13) is the tamper-RTC pin and as such is low current input. The pin mapping that I came up with: Arduino pin 2 = B7Īrduino pin 17 = C13, onboard led, input only. the loop function runs over and over again foreverĭigitalWrite(ledPin, HIGH) // turn the LED on (HIGH is the voltage level)ĭigitalWrite(ledPin, LOW) // turn the LED off by making the voltage LOW initialize digital pin LED_BUILTIN as an output. the setup function runs once when you press reset or power the board Number of accessible GPIO pins on the blue pill. I changed the led pin number starting with 2, progressing all the way to 31,the total Sketch is modified "blink" in the examples folder of the IDE.Īll pins responded to digitalWrite, Look at the datasheet for which pins are ADC and
This example code is in the public domain. Model, check the Technical Specs of your board at: If you want to know what pin the on-board LED is connected to on your Arduino It is attached to digital pin 13, on MKR1000 on pin 6. Most Arduinos have an on-board LED you can control.
Turns an LED on in a set pattern, then off for one second, repeatedly.
Modified Blink for "Blue Pill" STM32F103C8T6 I modified the blink sketch a small amount to set a pattern of flashes so there would be no mistake on what I was seeing. If this is helpful for others, it was worth the time I took this morning to do this. I could find no mapping of pins anywhere I looked between what the Arduino IDE would accept and the pin on the "blue pill". Let me start by saying it could be my lack of search abilities.