Datasheet
Usage of line following
Usage of ESP_NOW
Please refer to https://github.com/m5stack/M5-espnow
Single function resolution:
Usage of JOYSTICK
Usage of communication with PC software
lidarcar.Init();
GetData();//save radar data to array distance[]
#include "rprtrack.h"
Rprtrack rprtrack;
SensorStatus();// save line following data to array sensorValue[]
CalTrackDev();// handle array sensorValue[], get car offset and save it
arduino
/* Main program */
void loop()
{
espnow.RemoteConnectUpdate();// ESPNOW reconnect
keyboard.GetValue();// read data of joystick
// ESPNOW sends joystick data to car
esp_now_send(espnow.peer_addr, keyboard.keyData, 3);
MapDisplay();// display map
accessport.AnalzyCommand();// send map data to PC software
}
arduino
#include "keyboard.h"
KeyBoard keyboard;
keyboard.Init();
// get joystick data and save to adX, adY
GetValue();
arduino
#include "accessport.h"
AccessPort accessport;
accessport.AnalzyCommand();// send map data to PC software
arduino
M5Stack Docs
Program of RemoteController