Hi There
could someone help please, I am a 75 year, and the gray matter is eroding away.
I have made a pump and status controller which works well for my situation, however I want to display the LCD info on a duplicate remote second board via 2off HC12 Tranceivers
I have set Digital Pin 9 to HC12 RX and Digital Pin 10 to HC12 TX
.
I am asking if someone could give me the transmit coding and the receive coding,
I am using 2 Arduino Nano Boards, my thought is it possible to send the trig and echo data on board 1 to board 2,
I don't know how to go about it, or is there another way?
I have spent many days searching the internet for an answer but I cannot get my head around it.
SoftwareSerial syntax is (Rx,Tx) so be careful of the order. Where to from here? Hook it up and try to use it. All the other commands that you think you might need to know (the AT commands) are for changing the defaults. Get it working first.
Hello,
I have communication between both serial monitors but what I am trying to do is to send the (distance) value derived from the HCSR04 on the send board to the receiver so that it can process and display on the LCD, both boards will be powered by external sources with no computers attached.
You have your distance calculation, which you have unnecessarily declared to be long (unsigned int will suffice). You can either send (mySerial.Print) as an integer (2 or 4 byte) in which case you'll need to re-construct it at the other end, LSB arriving first, or convert the numeric value to ASCII characters and send one-by-one in which case just print them when they arrive.
If, when you say process, you plan some math, you'll probably be better off with the former. The latter would then need to re-assembled into a numeric value. The two C functions that would be of interest to you are atoi and itoa (ascii to integer and integer to ascii).
I am sorry for not explaining my self better I don't wish to process the distance calculations again on the receive board but use the distance value to print to the LCD and perform the operations from line 70 onward. Could you please give me the coding to do this as I don't understand the conversins you talk about.
Kind Regards
Doug
Hi again,
I have attached the send Sketch and the receive sketch, I hope this might explain what I am trying to do, in other words I want to send the value of (distance) in the send sketch to the receive sketch which will allow the receive sketch to display on the LCD the info required.
Could you please modify the coding in both sketches as required, your help with this would be more than greatly appreciated.