Created
May 16, 2020 01:20
-
-
Save komponenrobot/ea68c2c6a73a051f956ab03c6966c7c5 to your computer and use it in GitHub Desktop.
prot_PWM
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
void setup() { | |
pinMode(3, OUTPUT); | |
pinMode(4, OUTPUT); | |
pinMode(5, OUTPUT); | |
} | |
void loop() { | |
int dataAdc = analogRead(0); | |
int pwm = dataAdc / 4; | |
digitalWrite(4, HIGH); | |
digitalWrite(5, LOW); | |
analogWrite(3, pwm); | |
delay(1000); | |
digitalWrite(4, LOW); | |
digitalWrite(5, HIGH); | |
analogWrite(3, pwm); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment