Level 4

#include <LiquidCrystal.h>  // LCD library ကို include ပြုလုပ်ခြင်း

// LCD ကို Arduino board နှင့် ချိတ်ဆက်ခြင်း (RS, E, D4, D5, D6, D7)
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16, 2);  // 16 columns, 2 rows ထားသော LCD ကို initialize ပြုလုပ်ခြင်း
  lcd.print("Hello, World!");  // LCD screen ပေါ်တွင် "Hello, World!" ဟု ပြသခြင်း
}

void loop() {
  // Loop ထဲမှာဘာမှမလုပ်သေးပါ
  // ဒါကြောင့် LCD မှာ "Hello, World!" ပဲအမြဲပြသမည်။
}
#include <SPI.h>          // SPI communication library ကို include ပြုလုပ်ခြင်း
#include <MFRC522.h>      // MFRC522 RFID reader ကိုအသုံးပြုရန် library ကို include ပြုလုပ်ခြင်း

#define SS_PIN 10        // RFID module ၏ Slave Select (SS) pin ကို pin 10 နှင့် ချိတ်ဆက်ခြင်း
#define RST_PIN 9        // RFID module ၏ Reset (RST) pin ကို pin 9 နှင့် ချိတ်ဆက်ခြင်း

MFRC522 mfrc522(SS_PIN, RST_PIN); // MFRC522 object တစ်ခု ဖန်တီးခြင်း

void setup() {
  Serial.begin(9600);       // Serial monitor ကို 9600 baud rate ဖြင့်စတင်ခြင်း
  SPI.begin();              // SPI communication ကိုစတင်ခြင်း
  mfrc522.PCD_Init();       // RFID reader ကို initialize ပြုလုပ်ခြင်း
  Serial.println("Place your RFID card near the reader...");  // User ကိုအသိပေးမှု
}

void loop() {
  // RFID reader သည် ကတ်အသစ် တစ်ခု ရှိ/မရှိ စစ်ဆေးခြင်း
  if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) {
    return; // ကတ်မတွေ့လျှင် loop ကို ထပ်ပြန်စေမည်
  }

  Serial.print("UID tag: ");  // UID (Unique ID) ကို output ပြုလုပ်မည်
  for (byte i = 0; i < mfrc522.uid.size; i++) {  // UID ၏ အရွယ်အစားပမာဏထိ loop ပြုလုပ်မည်
    Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "); // Hex format အနေဖြင့် ထုတ်ပြမည်
    Serial.print(mfrc522.uid.uidByte[i], HEX);  // UID ကို HEX format ဖြင့် ပြမည်
  }
  Serial.println();  // Line ချန်ထားခြင်း

  mfrc522.PICC_HaltA();  // RFID card ကို Halt (လုပ်ငန်းရပ်) ပြုလုပ်ခြင်း
}

// Place your RFID card near the reader...
// UID tag:  F9 6C 38 A4

Last updated