Develop Routine Of TF Luna In Arduino

2y ago
123 Views
10 Downloads
334.00 KB
6 Pages
Last View : 5d ago
Last Download : 3m ago
Upload by : Jamie Paz
Transcription

Develop Routine of TF-Luna in ArduinoIn this routine, Arduino Uno and DUE board is taken as example, which is mainly for the user to quicklyfamiliarize himself with our LiDAR and thus save the time of product development.For detailed introduction and tutorial of Aruidno, please refer to following website:Arduino Official website: www.arduino.ccStep 1: Hardware ConnectionFigure 1 Schematic Diagram of Connection between TF-Luna and UNO BoardFigure 2 Schematic Diagram of Connection between TF-Luna and DUE BoardPage 1

Step 2: Program CompilationAt least two serial ports of Arduino are required for the achievement of this routine function with one forreceiving data of LiDAR and another for outputting data to PC for display. The user may either copyfollowing code and paste it in Arduino IDE program editing window or directly open relevant enclosed file./*This program is the interpretation routine of standard output protocol of TFmini-Plus product on Arduino.For details, refer to Product Specifications.For Arduino boards with only one serial port like UNO board, the function of software visual serial port isto be used.*/#include SoftwareSerial.h //header file of software serial portSoftwareSerial Serial1(2,3); //define software serial port name as Serial1 and define pin2 as RX and pin3as TX/* For Arduinoboards with multiple serial ports like DUEboard, interpret above two pieces of code anddirectly use Serial1 serial port*/int dist; //actual distance measurements of LiDARint strength; //signal strength of LiDARfloat temprature;int check; //save check valueint i;int uart[9];//save data measured by LiDARconst int HEADER 0x59;void setup() {Page 2//frame header of data package

Serial.begin(9600); //set bit rate of serial port connecting Arduino with computerSerial1.begin(115200);//set bit rate of serial port connecting LiDAR with Arduino}void loop() {if (Serial1.available()) {//check if serial port has data inputif(Serial1.read() HEADER) {//assess data package frame header 0x59uart[0] HEADER;if (Serial1.read() HEADER) { //assess data package frame header 0x59uart[1] HEADER;for (i 2; i 9; i ) { //save data in arrayuart[i] Serial1.read();}check uart[0] uart[1] uart[2] uart[3] uart[4] uart[5] uart[6] uart[7];if (uart[8] (check & 0xff)){ //verify the received data as per protocoldist uart[2] uart[3] * 256;//calculate distance valuestrength uart[4] uart[5] * 256; //calculate signal strength valuetemprature uart[6] uart[7] *256;//calculate chip tempraturetemprature temprature/8 - 256;Serial.print("dist ");Serial.print(dist); //output measure distance value of LiDARSerial.print('\t');Page 3

Serial.print("strength ");Serial.print(strength); //output signal strength valueSerial.print("\t Chip Temprature ");Serial.print(temprature);Serial.println(" celcius degree"); //output chip temperature of Lidar}}}}}Step 3: Viewing of DataDownload the code into Arduino board and open the serial monitor for the serial port. Then real-timedistance values as well as the corresponding strength and chip temperature can be viewed, as shown infigure 3.Page 4

Figure 3 Lidar data displayed on the monitor software by serial portIn addition, data curve can be viewed in the curve plotter for serial port, however, the above coding regardingthe print of serial port should be modified://Serial.print("dist ");Serial.print(dist); //output measure distance value of LiDARSerial.print(" ");//Serial.print("strength ");Serial.print(strength); //output signal strength value//Serial.print("\t Chip Temprature ");Serial.print(" ial.println(" celcius degree");Re-compile and download to Arduino board and open the curve plotter. Then two curves including the dist andstrength can be viewed, as shown in Figure 4.Page 5

Figure 4 Plots of TF-Luna data on Curve plotter for Serial PortPage 6

following code and paste it in Arduino IDE program editing window or directly open relevant enclosed file. /* This program is the interpretation routine of standard output protocol of TFmini-Plus product on Arduin

Related Documents:

sol y la luna están en la misma posición y salen al mismo tiempo. No podemos ver la luna nueva. La luna sale y se pone aproximadamente 50 minutos más tarde cada día. La luna parece “crecer” o crece cada día de luna nueva a luna llena. El lado brillante de la luna nueva apunta al sol poniente y puede ser vista

esfera de la Luna se ve del mismo tamaño aparente que la Luna y con la misma fase que la real. Variando la orientación del listón se consiguen reproducir las diferentes fases de la Luna al variar la iluminación que recibe del Sol. Hay que mover la Luna para conseguir la secuencia de todas las fases.

dalla Luna alla Terra. Calcolo l’ora in cui è avvenuto l’impatto sulla luna. Conoscendo il tempo t impiegato dalla luce per viaggiare tra la Luna e la Terra posso calcolare: t L -tt T -23 h 45min 56,1 s1 ,3 s 23 h 45 min 54,8 s. Il tempo impiegato dalla luce a percorrere la distanza Terra-Luna è di circa 1,3 s. Possiamo quindi .

è in congiunzione con il Sole, ovvero, dalla Terra, la Luna e il Sole si trovano nella stessa direzione nella volta celeste. La Luna è interposta fra il Sole e la Terra, la faccia rivolta alla Terra è in ombra. 2. Falce di luna. Si osserva nelle due fasi: Luna Crescente, il disco è parzialmente illuminato per meno della metà e rivolto

Bajo la misma luna: la simbología de la luna en Li Bai y Federico García Lorca 193 1. La metáfora en la cultura china y occidental2 La metáfora se define como una figura retórica que consiste en la sustitución de un elemento real por otro imaginario con el que guarda una relación de semejanza. La metáfora, por tanto, es un tropo

BAXI LUNA 310 Fi TECHNICAL INFORMATION . Baxi Luna Wall-Hung Boiler . User manual left on site It is very important that these steps be carried out in order to have the boiler . The BAXI LUNA 3.10 is supplied with a 1-meter cord, ready to plug into a nearby power outlet.

Luna Moth Actias luna Luna Moths are members of the Saturniidae family, also known as the “Giant Silkworm Moths.” Luna Moths are huge moths, with a wingspan of four and a half inches. They have a white body, pinkish legs, and huge pale green wings. The hindwings have eyespots and long tails. They fly, only at night, in Spring and early Summer.

La Luna Golden Butterfly 2016 Rhythmic Gymnastics Invitational March 5- 6th, 2016 HOSTED BY La Luna Rhythmic Gymnastics Academy Dear Rhythmic Gymnastics Friends, It is our pleasure to invite you to participate at our La Luna Golden Butterfly Invitational. Please join us in the beautiful Eas