I have been playing about with Arduino for quite a while now. I love using the Uno/Nano/ProMicro. For my next project I wanted to use something that could process information a little faster. I was drawn to the BlackPill STM32F401CCu6 as it stated that it was usable with Arduino IDE. Perfect, or so I thought.
So after a few days of fighting and head scratching, I finally managed to get the board connected and accepting a very basic blink sketch. I Followed the tutorial here:
https://www.sgbotic.com/index.php?dispa ... page_id=49
Now it was claimed that this board would simply make use of the USB port via DFU. I have not yet got this to work, but I have managed to use a nodeMCU board as a uart adaptor to download a sketch. Not perfect, but it is a start at least.
Now to my question.
Now that I have the blink sketch up and running, I want to be able to now use a button to activate the LED while pressed, and turn off when the button is released. I cant seem to get this really simple sketch to work. Here is code that I am trying:
Code: Select all
void setup() {
pinMode(PC13, OUTPUT);
pinMode(PB2 , INPUT_PULLUP);
}
void loop() {
if (digitalRead(PB2 == LOW) );
{ digitalWrite(PC13, HIGH); }
}
I also think that my board/Arduino IDE could be better setup. If someone could point me in the right direction to a tutorial that will get me setup better, I would greatly appreciate it.
I would really like to be able to use a tft display later down the line. I have found this tutorial, but it requires the use of libraries that have been adapted for STM32.
https://www.electronics-lab.com/project ... duino-ide/
Would I need to setup ArduinoIDE in a specific way to be able to do this?
Thank you all in advance.
Tim