Sarah - Processing Programming language

For this week’s group assignment, my task was to use Processing with an input or output.

Processing is an open-source IDE and programming language used to create Human-Machine Interfaces (HMI).

Why it’s favorable for fab academy projects

Test 1: Processing for controlling an LED with an ESP32-C3

Step 1: Software Installation & Setup

To get my ESP32-C3 talking to Processing, I need to prepare both environments.

  1. Install the Arduino IDE
  2. Install Processing: Download and install the latest version from processing.org.
  3. Install the ESP32 Board Manager:
  4. Identify the Port: Plug in the ESP32-C3 and go to Tools > Port in the Arduino IDE. Note the name (e.g., COM11 on Windows). You will need this exact string for the Processing code.

Step 2: The ESP32 "Receiver" Code

In this step, we will program the ESP32 to listen for a specific character sent over the USB cable (Serial) from the computer.

  1. Connect an LED to a digital pin (e.g., GPIO 2) with a 220Ω resistor.
  2. Open Arduino IDE and paste the following code:
const int ledPin = 2; // Change to your LED pin

void setup() {
  Serial.begin(115200);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  if (Serial.available() > 0) {
    char data = Serial.read();
    if (data == 'H') {
      digitalWrite(ledPin, HIGH);
    } else if (data == 'L') {
      digitalWrite(ledPin, LOW);
    }
  }
}