I am trying to send firefly_firmata to ESP32 wroom, but it seems like it requires some edits in the code rather than just upgading libraries. However, I am not proficient in code as I am only familiar with writing Grasshopper definitions and just started to learn electronics.
GPT says I should add this to file but I honestly have no idea how to complete it without errors.
#include <ESP32Servo.h>
Servo myServo; // Create servo object
void setup() {
- myServo.attach(18); // Attach servo on pin 18*
}
void loop() {
- for (int pos = 0; pos <= 180; pos += 1) { // Sweep from 0 to 180 degrees*
-
myServo.write(pos); // Set servo position*
-
delay(15); // Wait for the servo to reach the position*
- }*
- for (int pos = 180; pos >= 0; pos -= 1) { // Sweep back from 180 to 0 degrees*
-
myServo.write(pos);*
-
delay(15);*
- }*
}
Somebody else tried ESP32 with Firefly before? Is this possible?