🛠 Apprivoiser les connecteurs 80 broches : bouton, LED et entrée analogique

Arduino Portenta H7 · debutant · Schéma : IMG-portenta-h7-debutant-3-portenta-h7-broches-gpio.svg — Portenta H7 sur breadboard avec ses deux connecteurs 80 broches en bas de carte, bouton poussoir sur une broche D avec pull-up interne, potentiomètre sur une broche A, porteuse Breakout à côté annotée compatible H7 Lite et X8

Objectives

The Portenta H7 has neither a classic Arduino connector nor standard breadboard-friendly headers: its pinout is exposed through two stacked 80-pin high-density connectors (the "Arduino industrial" standard) under the board, plus an MKR-style connector footprint. These pairs expose UART, SPI, I²C… and also the embedded 10/100 Ethernet PHY. This tutorial teaches you how to read a button and a potentiometer, and how to understand the carrier ecosystem (Breakout, Max Carrier, Mid Carrier, Hat Carrier, Machine Control) that makes the pinout usable in the workshop.

Hardware

Full code

// bouton_potentiometre.ino — GPIO + ADC sur Portenta H7
// > 
// ADC et de sorties PWM routees sur les connecteurs 80 broches — la page
// pinout officielle (JS) n'a pas pu etre verifiee ; consulte la section
// pinout de docs.arduino.cc/hardware/portenta-h7 avant de cabler.

const int BROCHE_BTN = D7;    // bouton -> GND, actif a 0
const int BROCHE_ADC = A0;    // curseur du potentiometre

void setup {
  Serial.begin(115200);
  while (!Serial) {}
  pinMode(BROCHE_BTN, INPUT_PULLUP);   // pull-up interne, pas de R externe
  pinMode(LEDG, OUTPUT);
}

void loop {
  int brut = analogRead(BROCHE_ADC);   // ADC 12 bits (STM32H747 : 3 ADC)
  bool appuye = (digitalRead(BROCHE_BTN) == LOW);
  digitalWrite(LEDG, appuye ? HIGH : LOW);
  Serial.print("adc="); Serial.print(brut);
  Serial.println(appuye ? "  bouton=APPUIE" : "  bouton=repos");
  delay(100);
}

Expected verification

Turning the potentiometer scrolls the ADC value (the STM32H747 features 3 ADC converters, 2 DACs, and 2 ultra-low-power comparators), and the green LED follows the button press. A key point of the ecosystem: the 80-pin connectors are a mezzanine pin-compatible standard — you can replace an H7 with an H7 Lite or an X8 on the same carrier, and the 10/100 Ethernet PHY also passes through these connectors.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials