61 lines
2.9 KiB
C
61 lines
2.9 KiB
C
/*****************************************************************************************************
|
|
Programs for Arduino - Copyright of the author Stuart Robinson - 04/11/21
|
|
|
|
This program is supplied as is, it is up to the user of the program to decide if the program is
|
|
suitable for the intended purpose and free from errors.
|
|
*******************************************************************************************************/
|
|
|
|
//******* Setup hardware pin definitions here ! ***************
|
|
|
|
//These are the pin definitions for one of my own boards, the Easy Pro Mini,
|
|
//be sure to change the definitions to match your own setup. Some pins such as DIO2,
|
|
//DIO3, BUZZER may not be in used by this sketch so they do not need to be
|
|
//connected and should be included and be set to -1.
|
|
|
|
#define I2C_SDA 18
|
|
#define I2C_SCL 17
|
|
#define RADIO_SCLK_PIN 5
|
|
#define RADIO_MISO_PIN 3
|
|
#define RADIO_MOSI_PIN 6
|
|
|
|
#define NSS 7
|
|
#define RFBUSY 36
|
|
#define NRESET 8
|
|
#define LED1 37
|
|
#define DIO1 9
|
|
#define DIO2 -1//33
|
|
#define DIO3 -1//34
|
|
#ifdef LILYGO_T3_S3_V1_0
|
|
#define RX_EN 21
|
|
#define TX_EN 10
|
|
#define TX_POWER 3
|
|
#else
|
|
#define RX_EN -1
|
|
#define TX_EN -1
|
|
#define TX_POWER 13
|
|
#endif
|
|
|
|
#define LORA_DEVICE DEVICE_SX1280 //we need to define the device we are using
|
|
|
|
//******* Setup LoRa Parameters Here ! ***************
|
|
|
|
//LoRa Modem Parameters
|
|
const uint32_t Frequency = 2445000000; //frequency of transmissions in hz
|
|
const int32_t Offset = 0; //offset frequency in hz for calibration purposes
|
|
const uint8_t Bandwidth = LORA_BW_0800; //LoRa bandwidth
|
|
const uint8_t SpreadingFactor = LORA_SF8; //LoRa spreading factor
|
|
const uint8_t CodeRate = LORA_CR_4_5; //LoRa coding rate
|
|
const uint16_t Calibration = 11350; //Manual Ranging calibrarion value
|
|
|
|
const int8_t RangingTXPower = TX_POWER; //Transmit power used
|
|
const uint32_t RangingAddress = 16; //must match address in recever
|
|
|
|
const uint16_t waittimemS = 10000; //wait this long in mS for packet before assuming timeout
|
|
const uint16_t TXtimeoutmS = 5000; //ranging TX timeout in mS
|
|
const uint16_t packet_delaymS = 0; //forced extra delay in mS between ranging requests
|
|
const uint16_t rangeingcount = 5; //number of times ranging is cqarried out for each distance measurment
|
|
float distance_adjustment = 1.0000; //adjustment factor to calculated distance
|
|
|
|
|
|
#define ENABLEOLED //enable this define to use display
|
|
#define ENABLEDISPLAY //enable this define to use display
|