Old timer/extreme noobie! I haven’t touched programming in over 30 years. Back then it was Apple Basic language on an Apple II computer. There are many similarities to the language used for Arduino/C+
I know from all my previous searches one of the 1st replies is “post your existing code/sketch”. My existing is in about 6 or 7 different sketches currently. I still have more research to do. I am building it one part/piece at a time, then combining it all. I will attempt to tackle that monster once I cross this bridge.
The one thing I cannot find or reference is due to I do not know the proper terminology to search for.
I have a LoRa radio that is configured via hex commands. I need to input the frequency desired (903.3 for instance) on a 4 X 4 keypad, press my “enter” button on the keypad and have that number inserted into the write setting.
Below is the write setting for the LoRa radio with the word Frequency where I want to insert the keypad data
The frequency value in hex is equal to the number input X 1000. So the above example of 903.3 X 1000= 903300 which in hex is 0x0D 0xC8 0x84 can be either the 903300 or the hex value since the serial.write sends the data via binary.
What is it called when you have a serial.write with a variable input of the data that is entered from the keypad upon the enter button being selected/pushed?
Hi, old fox! Once a programmer, always a programmer.
Post the code of the current part of Your project/research! Building it, quoted, "building it one part/piece at a time" is the best. Good!
Values of the magnitude of 903300 needs a variable declared as long. You surely recall that all numbers are stored as 0:s and 1:s in the code. The presentation to us can be done in binary, octal, decimal, hexadecimal. All from the same basic variable.
Where the number comes from doesn't matter, keyboard, #define or what.
I don't know the Lora library, how Lora.write(largeValue) works. Check the documentation/example codes around Lora.
Searching for "Arduino + Lora" is what I would try the first. Then look at the links and inspect possible alternatives.
Two points…
The data is data, how it’s represented is only relevant to you not the system (unless it’s a hex string).
It gets sent to the device as binary ‘data’ in any case.
The second point is - be careful if you’re letting users set the radio frequency - on several levels.
In most countries only one or two bands are legal for unlicensed comms. If they step out, and interfere with some other service,the penalties can be extreme.
Also, the antenna will often be different for different bands, affecting the range.
One piece at a time is the right way. You would be surprised how many people want to jump right into the deep end where the rocks are.
Combining sketches is not a big problem. I strongly recommend that you put as much as you can into discrete functions no matter how trivial they are. It will make combining the sketches much easier later.
30 years? You're a youngster. I cut my programming teeth on Fortran 2. BASIC had just been invented. I started my programming career using HPL.
John yes the freq is represented in three bytes. I will have to do a little research on the what you have given me. The big thing is I am working with a range from 902.0 to 915.0 in tenth increments.
RailRoader, from my research there isn't a Lora library made for the module I am using. Most of them use AT commands to change parameters. The model I have to use to match a 3rd party equipment built-in Lora radio uses Hex. Some parameters are very easy like Kbps, baud rate etc as they assigned 00x0 to 1200 baud, 0x01 to 2400, 0x02 to 4800 and so on.
Frequency is equal to the hex value of the frequency by multiplying by 1000, so 903.3 X 1000 = 903300 which is represented in Hex as 0x0D 0xC8 0x84 writing it to serial makes it binary so like lastchancename said, data is data it is sending 0's and 1's
Lastchancename, the United States 900 band is very broad provided your transmit power is less than 1 watt. The range I am working in is 902.0 to 915.0 with 100 mW max.
Steve, I am assuming you stayed with it. I just started tinkering with it again just a bit over year now. I am sure most us "mature" users know, if you don't use it you lose it.