safehaul — ESP32 simulation

SIH

An interactive ESP32 circuit simulation you can run free in your browser on Velxio, by ramcharantejajakkam.

Components

Sketch code

#include <Wire.h>

#define SDA_PIN 32
#define SCL_PIN 33
#define SLAVE_ADDR 0x08

volatile bool received = false;

void receiveEvent(int howMany) {
  Serial.print("Received: ");

  while (Wire.available()) {
    char c = Wire.read();
    Serial.print(c);
  }

  Serial.println();
  received = true;
}

void setup() {
  Serial.begin(115200);

  Wire.begin(SLAVE_ADDR, SDA_PIN, SCL_PIN, 100000);

  Wire.onReceive(receiveEvent);

  Serial.println("ESP32 #2 waiting...");
}

void loop() {
  delay(10);
}

More projects by ramcharantejajakkam