Last active
September 4, 2022 14:51
-
-
Save hekras/02d2220d7c5b3723a0e7ac4f43ff106d to your computer and use it in GitHub Desktop.
Test af ESP8266 interface til 2x motor via L293
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
uint8_t Pwm1 = 5; //Nodemcu PWM pin | |
uint8_t Pwm2 = 4; //Nodemcu PWM pin | |
//Seven segment pins attachecd with nodemcu pins | |
int a0 = 15; //Gpio-15 of nodemcu esp8266 | |
int a1 = 13; //Gpio-13 of nodemcu esp8266 | |
int a2 = 12; //Gpio-12 of nodemcu esp8266 | |
int a3 = 14; //Gpio-14 of nodemcu esp8266 | |
void setup() { | |
// pinMode(LED_BUILTIN, OUTPUT); | |
pinMode(a0, OUTPUT); | |
pinMode(a1, OUTPUT); | |
pinMode(a2, OUTPUT); | |
pinMode(a3, OUTPUT); | |
delay(10000); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
digitalWrite(a0, LOW); | |
digitalWrite(a1, HIGH); | |
digitalWrite(a2, HIGH); | |
digitalWrite(a3, LOW); | |
analogWrite(Pwm1, 150); | |
analogWrite(Pwm2, 150); | |
delay(2000); | |
digitalWrite(a0, LOW); | |
digitalWrite(a1, LOW); | |
digitalWrite(a2, LOW); | |
digitalWrite(a3, LOW); | |
delay(1000); | |
digitalWrite(a0, HIGH); | |
digitalWrite(a1, LOW); | |
digitalWrite(a2, HIGH); | |
digitalWrite(a3, LOW); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment