i belive brainpad should work well since have similiar to nucleo mcu but just need to now which pins is used for button - leds - temperature sensor - oled and it could used as is with arduino ide too.
Here is the code:
The LEDs should blink red or blue depending on the button state
int state = LOW;
void setup()
{
// initialize digital pin as an output.
pinMode(pinNametoDigitalPin(PC6), OUTPUT); // Blue
pinMode(pinNametoDigitalPin(PC9), OUTPUT); // Red
pinMode(pinNametoDigitalPin(PA5), INPUT);
// Edit: this was wrong, must be:
//pinMode(pinNametoDigitalPin(PA5), INPUT_PULLUP);
}
void loop()
{
state = digitalRead(pinNametoDigitalPin(PA5));
if (state == HIGH)
{
digitalWrite(pinNametoDigitalPin(PC9), HIGH); // turn the red LED on
delay(100); // wait for a time
digitalWrite(pinNametoDigitalPin(PC9), LOW); // turn the red LED off
delay(100); // wait for a time
}
else
{
digitalWrite(pinNametoDigitalPin(PC6), HIGH); // turn the blue LED on
delay(100); // wait for a time
digitalWrite(pinNametoDigitalPin(PC6), LOW); // turn the blue LED off
delay(100); // wait for a time
}
}
Yes you can do similiar to Arduino without any change
void setup()
{
Serial2.begin(9600);
}
void loop()
{
Serial2.print(" Hello World");
}
On STM32F401/411 :
Stm Uart1 (pa2,pa3) = Arduino Serial
Stm Uart2 (pa9,pa10)= Arduino Serial1
Stm Uart6 (pa11,pa12 also as usb otg)= Arduino Serial2
But for upload direkt should be used Uart1
Under Menu on Arduino Ide set Serial to All
Or Connect pa2/pa3 ,gnd and vcc to any usb uart
@RoSchmi
P.S.
Forgot one thing Arduino IDE should show like a mass storage or ST Link device for upload after compile otherwise minitoring uart should work
Partial success: I can now use Serial.println to get messages from the BrainPad through a GHI Rs232 Module to the Serial Port of my PC.
The RS232 Module is connected to PA2 of the BrainPad as TX (Expansion Header Pin 15 (INT).
However, if I activate in the Arduino IDE Tools -> Other Serial Instance: ALL or Serial1(if available) or Serial2(if available)
I get a compiler error:
Arduino: 1.8.3 (Windows 10), Board: “Nucleo-64, Nucleo F401RE, Mass Storage, All, None”
arm-none-eabi-gcc: error: C:\Users\Roland\AppData\Local\Temp\arduino_build_963841/…\arduino_cache_729421\core\core_STM32_stm32_Nucleo_64_board_part_num_NUCLEO_F401RE,
upload_method_MassStorageMethod,Other_serial_enable_SerialAll,USB_interface_enable_USB_ba6ca7138be2b72e751689a40e15ca39.a:
No such file or directory
exit status 1
Fehler beim Kompilieren fĂĽr das Board Nucleo-64.
Tried to adapt the Adafruit Adafruit_SSD1306 I2C library for the STM32F401 Mainboard, but no success.
The BrainPad display works fine on an Arduino Pro mini with the Adafruit library.
Does anybody have an Arduino library that works on the STM32F401 Mainboard?
Hmm, the oled on the new BrainPad seems to be a 128x32 display (on an Arduino Pro Mini it works with this configuration). Your example was for a 128x64 display. Did you get it working on the new BrainPad or on a Nucleo-401RE board? Could you please send me a copy of your …\variants\NUCLEO_F401RE folder? If this doesn’t help, I would have to search systematically for the reason.