IR Wireless Remote Control Module Kits. Med dette sæt kan du med flere varianter af IR betjeninger/Remoter styre en arduino.
Tekniske detaljer:
Battery:CR2025 Button batteries – Batteri er ikke i pakken.
Transmission Distance: up to 8m
Effective Angle: 60°
Static Current: 3~5uA, Dynamic Current: 3~5mA
Receive standard: 38 KHZ
Remote size:8.5 x 4 x 0.65cm(L x W x H)
Remotes som kan bruges:
DENON
SHARP
JVC
PANASONIC
LG
SAMSUNG
SONY
Installere Arduino IDE Software
Før du kan starte din programmering skal Arduino’s IDE software hentes. Dette program bruges til at programmere chippen.
Download fra dette link: Downlaod
Installere IRremote Library
- Download library (Download)
- Udpak filer
- Flyt/kopir mappen “IRremote” til “libraries” som findes i “Arduino IDE” mappen (C:\Program Files (x86)\Arduino\libraries)
- Åben Arduino IDE software og klik på “Sketch/Include library”
- Klik nu på “Add Zip. library” og find Zip filen du lige har downloaded.
- Åben “Manage” for at opdatere library.
- Luk, og åben Arduino IDE programmet. (Genstart programmet)
- Nu er IRremote Library installeret
Programmering
Inden programmeringen kan udføres skal den rigtige “COM” port findes. Klik “Værktøj/Port” – og vælg COM port.
Eksempel
Her vises er eksempel på hvordan du med en remote kan kontrollere en arduino. Du skal åbne “Serial monitor” for at se data.
Du skal bruge:
Forbind sådan:
VCC – 5 V
GND – GND
S– Digital pin 2
Hvis der skal monteres en LED som kan slukke og tænde skal den monteres på pin 12.
Kode: (Fil/Eksempler/IRremote/Simple resiver)
//#define DECODE_DENON
//#define DECODE_SHARP // the same as DECODE_DENON
//#define DECODE_JVC
//#define DECODE_KASEIKYO
//#define DECODE_PANASONIC // the same as DECODE_KASEIKYO
//#define DECODE_LG
#define DECODE_NEC
//#define DECODE_SAMSUNG
//#define DECODE_SONY
//#define DECODE_RC5
//#define DECODE_RC6
//#define DECODE_BOSEWAVE
//#define DECODE_LEGO_PF
//#define DECODE_MAGIQUEST
//#define DECODE_WHYNTER
//#define DECODE_HASH // special decoder for all protocols
#include <Arduino.h>
/*
* Define macros for input and output pin etc.
*/
#include “PinDefinitionsAndMore.h”
#include <IRremote.h>
int LedPin = 12; // choose the pin for the LED
void setup() {
Serial.begin(115200);
pinMode(LedPin, OUTPUT);
// Just to know which program is running on my Arduino
Serial.println(F(“START ” __FILE__ ” from ” __DATE__ “\r\nUsing library version ” VERSION_IRREMOTE));
/*
* Start the receiver, enable feedback LED and take LED feedback pin from the internal boards definition
*/
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);
Serial.print(F(“Ready to receive IR signals at pin “));
Serial.println(IR_RECEIVE_PIN);
}
void loop() {
/*
* Check if received data is available and if yes, try to decode it.
* Decoded result is in the IrReceiver.decodedIRData structure.
*
* E.g. command is in IrReceiver.decodedIRData.command
* address is in command is in IrReceiver.decodedIRData.address
* and up to 32 bit raw data in IrReceiver.decodedIRData.decodedRawData
*/
if (IrReceiver.decode()) {
// Print a short summary of received data
IrReceiver.printIRResultShort(&Serial);
if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
// We have an unknown protocol here, print more info
IrReceiver.printIRResultRawFormatted(&Serial, true);
}
Serial.println();
/*
* !!!Important!!! Enable receiving of the next value,
* since receiving has stopped after the end of the current received data packet.
*/
IrReceiver.resume(); // Enable receiving of the next value
/*
* Finally, check the received data and perform actions according to the received command
*/
if (IrReceiver.decodedIRData.command == 0x11) {
digitalWrite(LedPin, HIGH);
} else if (IrReceiver.decodedIRData.command == 0x12) {
digitalWrite(LedPin, LOW);
}
}
}
Kontakt os
Du er altid velkommen til at kontakte os på info@ardustore.dk, eller sende os en besked via messenger (Klik her) og vi vil hjælpe dig.
Anmeldelser
Der er endnu ikke nogle anmeldelser.