Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🎵 hal::transc

RF Transceivers & Wireless Communication

366 satır nRF24/LoRa

📖 Genel Bakış

RF transceiver drivers: nRF24L01, LoRa, Bluetooth.

🚀 Kullanım

içe_aktar hal::transc

// Initialize nRF24L01
değişken nrf = transc.nrf24_init(yap
    ce_pin: gpio.PA0,
    csn_pin: gpio.PA1,
    spi: spi1,
    channel: 76,
    data_rate: transc.DR_2MBPS
son)

// Send packet
transc.nrf24_send(nrf, [0x01, 0x02, 0x03])

// Receive packet
eğer data = transc.nrf24_receive(nrf, 100) ise yap
    io.println("Received: {:?}", data)
son

// LoRa module
değişken lora = transc.lora_init(yap
    frequency: 915_000_000,  // 915 MHz
    bandwidth: transc.BW_125KHZ,
    spreading_factor: 7
son)

transc.lora_send(lora, "Hello LoRa!")

← HAL Modülleri