Programming without Arduino.h file

Muhtasim Rahman

New member
Is there another library I can call other than the Arduino library, that has some useful functions like the STM32 HAL Library with setting GPIO pin high and low? I'm trying to move past the Arduino and learn how to write more professional c++ code. Suggestions?
C++:
#include <Arduino.h>

int main(){
 
  bool led_state = HIGH;

  pinMode(LED_BUILTIN, OUTPUT);

  while(1){
    digitalWrite(LED_BUILTIN, led_state);
    led_state = !led_state;
    delay(1000);
    
  }

  return 0;

}
 
If you don't want to use Arduino, you probably should not be using Teensy. If you have experience with STM32, why not use that?
 
If you don't want to use Arduino, you probably should not be using Teensy. If you have experience with STM32, why not use that?
This is a valid point. I recently got a Teensy and wanted to program with it bare metal but after looking through the teensy core source code, it almost seems trivial to reimplement functions already provided in the source code.
 
You could include imxrt.h if your goal is to do everything with only the hardware registers but never use any Arduino APIs.

This header is one of many automatically included when you use Arduino.h, so you always have access to all the hardware registers documented in the reference manual when using the Arduino stuff. Maybe just starting to use the hardware registers without losing the Arduino APIs is a more realistic transition than immediately discarding so much so quickly. You can always just edit your program to including Arduino.h or only imxrt.h and compile to find out which stuff you still have that's depending on Arduino API.
 
Back
Top