lucianoalvs / aaaaa

0 stars 0 forks source link

aaaaa #1

Open lucianoalvs opened 2 years ago

lucianoalvs commented 2 years ago

include

int RECV_PIN = 11; // define input pin on Arduino IRrecv irrecv(RECV_PIN); decode_results results; // decode_results class is defined in IRremote.h void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } delay (100); // small delay to prevent reading errors }

lucianoalvs commented 2 years ago

Concordo!

include

int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results;

define motor3pin1 7

define motor3pin2 6

define motor2pin1 5

define motor2pin2 4

define motor1pin1 3

define motor1pin2 2

void setup() { irrecv.enableIRIn();

pinMode(motor1pin1, OUTPUT); pinMode(motor1pin2, OUTPUT);

pinMode(motor2pin1, OUTPUT); pinMode(motor2pin2, OUTPUT);

pinMode(motor3pin1, OUTPUT); pinMode(motor3pin2, OUTPUT); }

void loop() {

if (irrecv.decode(&results)) { digitalWrite(motor1pin1, LOW); digitalWrite(motor1pin2, HIGH);

digitalWrite(motor2pin1, LOW); digitalWrite(motor2pin2, HIGH);

digitalWrite(motor3pin1, HIGH); digitalWrite(motor3pin2, LOW);

irrecv.resume(); // Receive the next value }

}