Advertisement
Guest User

Untitled

a guest
Apr 30th, 2021
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. // STM32F407ZGT6
  2. // VSCode + Platformio
  3.  
  4. HardwareTimer *MyTim;
  5.  
  6. void UpdateLED(HardwareTimer *htim) {
  7.   digitalWrite(LED_BUILTIN,!digitalRead(LED_BUILTIN));
  8. }
  9.  
  10. // runs once on machine start
  11. void setup() {
  12.   Serial.begin(57600);
  13.   pinMode(LED_BUILTIN,OUTPUT);
  14.   MyTim = new HardwareTimer(TIM1);
  15.   MyTim->setOverflow(10,HERTZ_FORMAT);
  16.   MyTim->attachInterrupt(UpdateLED);
  17.   MyTim->resume();
  18. }
  19.  
  20. void loop() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement