Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

#include <Arduino.h>
#include <ESPectro32_Board.h>
#include <ESPectro32_LedMatrix_Animation.h>
ESPectro32_LedMatrix_Animation ledMatrixAnim;
void setup() {
ESPectro32.begin();
ledMatrixAnim.setLedMatrix(ESPectro32.LedMatrix());
#include <Arduino.h>
#include <WiFi.h>
#include <ESPectro32_Board.h>
#include <ESPectro32_RGBLED_Animation.h>
RgbLedColor_t aCol(200, 0, 0);
RgbLedColor_t bCol(0, 200, 0);
ESPectro32_RGBLED_GlowingAnimation glowAnim1(ESPectro32.RgbLed(), aCol);
ESPectro32_RGBLED_GlowingAnimation glowAnim2(ESPectro32.RgbLed(), bCol);
#include <Arduino.h>
#include <ESPectro32_Board.h>
#include <ESPectro32_RGBLED_Animation.h>
RgbLedColor_t aCol(0, 255, 0);
RgbLedColor_t bCol(255, 0, 0);
ESPectro32_RGBLED_GlowingAnimation glowAnim1(ESPectro32.RgbLed(), aCol);
ESPectro32_RGBLED_GlowingAnimation glowAnim2(ESPectro32.RgbLed(), bCol);
#include <ESPectro32_LedMatrix_Animation.h>
#include <Arduino.h>
#include <PWM.h>
PWM pwm(GPIO_NUM_15); // Pin LED yang terhubung di ESPectro32
void setup() {
pwm.setFrequency(5000); // Frekuensi sinyal pwm
}
void loop() {
for (int i = 0; i <= 1023; i++) {
#include <Arduino.h>
#include <ESPectro32_Board.h>
void setup() {
}
void loop() {
for (int i = 0; i <= 1023; i++) {
ESPectro32.analogWrite(15, i); // 15 : pin LED , i = Duty Cycle
delay(10);
}
for (int i = 1023; i >= 0; i--) {
#include <Arduino.h>
#include <ESPectro32_Board.h>
void setup() {
ESPectro32.begin();
ESPectro32.fadeLED(10000,5);
delay(100);
}
void loop() {
}
int frequency = 5000; // Frekuensi sinyal pwm
int ledChannel = 5; // Pilih salah satu PWM channel 0-15
int resolution = 10; // Resolusi sinyal : 8,10,12,15
int ledPin = 15; // Pin LED yang terhubung di ESPectro32
void setup() {
ledcSetup(ledChannel, frequency, resolution);
ledcAttachPin(ledPin, ledChannel);
}
void loop() {
//Phototransistor terhubung pada GPIO 36 di board ESPectro32
int photoPin = 36;
float potValue = 0;
float potVoltage = 0;
void setup() {
Serial.begin(9600);
delay(500);
}
void loop() {
#include <Arduino.h>
#include <ESPectro32_Board.h>
void setup() {
Serial.begin(9600);
ESPectro32.begin();
}
void loop() {
Serial.print("Photo Transistor Value: ");
Serial.println(ESPectro32.readPhotoTransistorValue());
int LED = 15; // LED di pin IO15 pada espectro32
int button = 4; // Button di pin IO4 pada espectro32
void setup() {
pinMode(LED, OUTPUT); //Led Sebagai Output
pinMode(button, INPUT); // Button Sebagai Input
}
void loop() {
int buttonState = digitalRead(button);
if (buttonState == HIGH) {