gpio_blink: Auf die Hardware zugreifen

Im Prinzip ist dieser Sketch der Blink-Sketch von Arduino, angepasst auf T-FPGA.

Arduino gpio_blink.inp
#include <PowerLib.hpp>
#define LED_BUILTIN 46

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  // T-FPGA Spannungsprofil programmieren
  if (Axp2101PwrOn() != ESP_OK) {
    Serial.println("FEHLER: T-FPGA Initialisierung fehlgeschlagen!");
  }
}
// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // change state of the LED by setting the pin to the HIGH voltage level
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // change state of the LED by setting the pin to the LOW voltage level
  delay(1000);                      // wait for a second
}
Zeile 1