项目作者: ElectronicCats

项目描述 :
MakeCode package LoRa by Electronic Cats - beta
高级语言: C++
项目地址: git://github.com/ElectronicCats/pxt-lora.git
创建时间: 2018-10-09T22:22:51Z
项目社区:https://github.com/ElectronicCats/pxt-lora

开源协议:MIT License

下载




Build Status

LoRa

Package adds support LoRa

Compatible Hardware

Install extension

Enter to Maker MakeCode

1.- Select “New Project”

2.- Select MKR1300 Arduino board
boards2

3.- Go menu -> Advanced -> Extensions and copy the next link

  1. https://github.com/ElectronicCats/pxt-lora

press enter select packages in menu

paquetes2

paquetes3

paquetes4

Usage

The package adds support LoRa for Arduino MKR1300.

An library for sending and receiving data using LoRa radios.

Testing receive

Install arduino-lora library in arduino, and upload firmware to arduino mkr1300 for receiver data
https://github.com/sandeepmistry/arduino-LoRa/blob/master/examples/LoRaReceiver/LoRaReceiver.ino

Open monitor serial and wait data

API

send

Write Packet to send. Each packet can contain up to 255 bytes.

  1. lora.send("Hello")

readVersion

Read Version of chip.

  1. let version = lora.readVersion()

available()

Returns number of bytes available for reading.

  1. let data = 0
  2. forever(function () {
  3. if (lora.available() < 0) {
  4. data = lora.read()
  5. }
  6. })

read

Read the next byte from the packet.

  1. let data = lora.read()

packetRssi()

Returns the RSSI of the received packet.

  1. rssi = lora.packetRssi()

parsePacket

Check if a packet has been received.

  1. rssi = lora.parsePacket(0)

Pins Used

The following pins are used for LoRa:

  • -PA15- LORA SPI - MOSI
  • -PA12- LORA SPI - MISO
  • -PA13- LORA SPI - SCK
  • -PA14- LORA SPI - CS
  • -PB09- LORA SPI - BOOT
  • -PA27- LORA SPI - RST

License

MIT

Supported targets

  • for PXT/maker
  1. package lora