6.4 Command – remote control, red and blue
LED (9-in-1 shield)
For this assignment, the infrared receiver is set to 9-in-1
shield used. See figure 47 right.
To send the infrared signal the
remote control used, supplied with the robot car. See
image left.
Program the following for the remote control:
A button to turn on the red LED
A button to turn on the blue LED
One button to turn on both LEDs
A button to turn off the red LED
A button to turn off the blue LED
A button to turn off both LEDs
We will assist you to write code. So show your attempt.
Please note that we have no idea what a9-in-1 shield is. Your text is talking about two images. So where are they?
Yes but i have tried it myself
From the guide on How to get the best out of this forum:
In my opinion, this paragraph should be posted much more prominently, not buried most of the way down a wall of text.
A 9 in 1 shield with IR receiver and a red and a blue led: https://www.aliexpress.com/i/1005004504447306.html
I can not find a schematic, but here they say:
LED1 (blue): D13
LED2 (red): D12
SW1 (button): D2
SW2 (button): D3
DHT11: D4
Buzzer (either a passive piezo element or a active buzzing one): D5
IR Receiver: D6
RGB LED: D9, D10 en D11
Potentiometer: A0
LDR: A1
LM35: A2
2 Digital pins: D7 en D8
1 Analoge pin: A3
I2C bus: SDA A4, SCL A5
UART bus: TXD en RXD
The Wokwi simulator can simulate a IR remote and has leds and a RGB led:
Add a red led and a blue led in Wokwi, and find an example how to use the IRremote library. If that works, then upload that sketch to your Arduino board and it should work.
Why stop there ? Control the buzzer with the remote and the RGB led as well.
Who can write this code, I can't figure it out myself.
I can help... getting started is half the project...
#include<IRremote.h> // find the most recent library
#define buttonPin 2
#define redLED 5
#define blueLED 6
void setup() {
pinMode(redLED, OUTPUT);
pinMode(blueLED, OUTPUT);
// your turn
}
void loop() {
// your turn
}
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.