WhiteSpace
Well-known member
Some of you may have seen my two recent posts, https://picaxeforum.co.uk/threads/dual-ssd1306-displays.32305/ on the subject of setting up two separate OLED displays off the same Picaxe, and https://picaxeforum.co.uk/threads/scanning-tof10120-with-output-to-oled.32283/ on using a stepper motor to rotate a laser time-of-flight sensor and sending the output to an OLED to create a radar-like range display, using range and angle to run sine and cosine calculations to give x,y that then plots to the OLED. Both parts are now working nicely. The next step in this over the top project is to send the TOF10120 data from the scanner (mounted on a vehicle) to the control unit, which will have two OLEDs, one for the LIDAR image and one for the IR motor control back the other way, so that the controller can see obstacles and navigate round them. Predictably, it's starting to get tricky! The TOF scanner outputs two bytes of range data up to 255, and there will also be the angle byte from the stepper to allow the sine/cosine calculation. If I understand correctly, IROUT can only send up to 127, so I can't send the TOF data in its original format. So the best solution seems to be to do some pre-processing on the vehicle and send the x (0 to 127) and y (0 to 63). There are two obstacles. Firstly , is there any way of identifying which byte is which? If I send irout PIN, device, variable, is there any way in which the receiver can identify that the byte that it receives is the x or the y? With serial it would be possible to use a qualifier to identify x and y (in fact presumably I could use "x" and "y" as qualifiers to make it very clear). But if I send via IR, I can send only one byte at a time and there's no guarantee that two consecutive bytes that are received are related, because one byte might not have been received. Any solutions from others who have tried something similar? And secondly, transmitting the data via IR really slows down the stepper, to the extent that the scanner will scan too slowly to produce usable data. Again, any solutions, please? Are there any better methods for transmitting data from A to B quickly? Should I look at RF? Am I just being too ambitious? Any suggestions would be gratefully received! Thanks
Last edited: