Jump to content
Fórum Script Brasil
  • 0



int pot = A0;
void setup()

  pinMode(2, OUTPUT);
  pinMode(A0, INPUT);


void loop()
 pot = analogRead(A0);
  if(pot == 0);
 digitalWrite(2, LOW);
 digitalWrite(3, LOW);
 digitalWrite(4, LOW); 
 if(pot > 1 & pot < 255);
 digitalWrite(2, HIGH);
 digitalWrite(3, LOW);
 digitalWrite(4, LOW); 

 Estou tentando fazer o led acender apenas quando chega no 1, mas eu início o teste no tinkercad ele acende na hora. Alguém sabe como arrumar?

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...