Hello everybody
I have this Arduino : 4duino - https://store.arduino.cc/4duino-24-lcd
I have a problem with my program, I plugged into my arduino a laser distance detector (Lidar 3). Remote reading works completely but the measurements are displayed in the serial monitor. I would like the distance measurements to be displayed on the screen even if it is in the middle I will adapt the code after but I can not display anything on the screen.
Could someone help me please?
Advanced thanks for your help
This is my code for the moment :
#include <Wire.h>
#include <LIDARLite.h>
#include "Picaso_Serial_4DLib.h"
#include "Picaso_Const4D.h"
// Globals
LIDARLite lidarLite;
int cal_cnt = 0;
int Laser = 10;
void setup()
{
Serial.begin(9600); // Initialiser la connexion série pour afficher les lectures de distance
lidarLite.begin(0, true); // Définir la configuration par défaut et I2C sur 400 kHz
lidarLite.configure(0); // Changer ce nombre pour essayer d'autres configurations
pinMode(Laser, OUTPUT);
}
void loop()
{
int dist;
// Au début de chaque centaines de lectures,
// prendre une mesure avec correction de polarisation du récepteur
if ( cal_cnt == 0 ) {
dist = lidarLite.distance(); // Avec correction bias
} else {
dist = lidarLite.distance(false); // Sans correction bias
}
// Incrémenter le compteur de lecture
cal_cnt++;
cal_cnt = cal_cnt % 100;
// afficher la distance
Serial.print(dist);
Serial.println(" cm");
//Allumer le Laser losqu'un obstacle franchit la distance choisie
if (dist < 50){
digitalWrite(Laser,HIGH);}
else {
digitalWrite(Laser,LOW);}
}