Codey OnlineBiblioteka komponentów Arduino i ESP32 › IR Receiver (VS1838B)
IR Receiver (VS1838B)
Czujniki

IR Receiver (VS1838B)

VS1838B to moduł odbiornika IR, który wykrywa modulowane sygnały podczerwieni z pilota i wystawia sygnał cyfrowy na OUT. Zwykle podłącza się go do VCC, GND oraz GPIO mikrokontrolera, aby odczytywać komendy IR.

Szerokość: 8.6 mm

Pinout — IR Receiver (VS1838B)

Pin Sygnał Opis
OUT digital Demodulated IR receiver output — connect to a microcontroller digital input
GND ground Ground reference for the IR receiver module
VCC power Positive supply for the IR receiver, typically 3.3V or 5V

Przykładowy schemat połączeń — IR Receiver (VS1838B)

Z Do Przewód
board:5V x1:VCC red
board:GND x1:GND black
board:D2 x1:OUT green

Przykładowy kod Arduino — IR Receiver (VS1838B)

Ten przykład został napisany i sprawdzony kompilacją dla arduino-uno. Codey Online dostosuje go do każdej innej obsługiwanej płytki.

// Canonical beginner example for the VS1838B IR Receiver
// Wiring:
// - VCC -> 5V
// - GND -> GND
// - OUT -> D2

#include <IRremote.hpp>

constexpr uint8_t IR_RECEIVE_PIN = 2;

void setup() {
  Serial.begin(115200);
  while (!Serial) {
    ;
  }

  IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);

  Serial.println(F("VS1838B IR Receiver example"));
  Serial.println(F("Point a TV remote at the receiver and press buttons."));
  Serial.println(F("Decoded IR data will appear here."));
}

void loop() {
  if (IrReceiver.decode()) {
    IrReceiver.printIRResultShort(&Serial);
    Serial.println();
    IrReceiver.resume();
  }
}

Podobne komponenty

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Zbuduj swój projekt Arduino lub ESP32 z pomocą AI

Opisz, co chcesz zbudować. Codey Online napisze kod, narysuje schemat połączeń, skompiluje projekt i wgra go na płytkę bezpośrednio z przeglądarki.

Zacznij za darmo