Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int analogInput = A2;
- int pwmOutput = 3;
- void setup() {
- // put your setup code here, to run once:
- pinMode(analogInput, INPUT);
- pinMode(pwmOutput, OUTPUT);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if(analogRead(analogInput)>300){
- analogWrite(pwmOutput, 200);
- }
- else{
- analogWrite(pwmOutput, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement