0% found this document useful (0 votes)
2 views3 pages

Doismotores

The document contains an Arduino sketch that initializes several pins as outputs and controls their states in a loop. It sets specific pins to HIGH or LOW in a sequence with delays, effectively creating a pattern of activation and deactivation. The code is designed to run indefinitely, alternating between two sets of pin states every few seconds.

Uploaded by

gabrielsamaral65
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Doismotores

The document contains an Arduino sketch that initializes several pins as outputs and controls their states in a loop. It sets specific pins to HIGH or LOW in a sequence with delays, effectively creating a pattern of activation and deactivation. The code is designed to run indefinitely, alternating between two sets of pin states every few seconds.

Uploaded by

gabrielsamaral65
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

int in1=4;

int in2=2;

int in3 =5;

int in4=6;

int enable2=7;

int enable=3;

void setup()

pinMode(enable, OUTPUT);

pinMode(in1, OUTPUT);

pinMode(in2, OUTPUT);

pinMode(enable2, OUTPUT);

pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);

digitalWrite(in1,LOW);

digitalWrite(in2,LOW);

digitalWrite(enable,LOW);

digitalWrite(in3,LOW);

digitalWrite(in4,LOW);

digitalWrite(enable2,LOW);

void loop()

digitalWrite(in1, HIGH);

digitalWrite(in2, LOW);

digitalWrite(enable, HIGH);

digitalWrite(in4, HIGH);

digitalWrite(in3, LOW);

digitalWrite(enable2, HIGH);

delay(2000);

digitalWrite(enable, LOW);

digitalWrite(enable2, LOW);

delay(1000);

digitalWrite(in1, LOW);

digitalWrite(in2, HIGH);

digitalWrite(enable, HIGH);
digitalWrite(in4, LOW);

digitalWrite(in3, HIGH);

digitalWrite(enable2, HIGH);

delay(2000);

digitalWrite(enable, LOW);

digitalWrite(enable2, LOW);

delay(1000);

You might also like