This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <ESPectro32_Board.h> | |
void setup() { | |
ESPectro32.begin(); | |
ESPectro32.fadeLED(10000,5); | |
delay(100); | |
} | |
void loop() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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--) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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++) { |
OlderNewer