This commit is contained in:
2024-10-24 12:52:37 +02:00
parent 990d064766
commit 294af308ec

View File

@@ -9,18 +9,20 @@
using namespace std; using namespace std;
CKobuki robot; CKobuki robot;
int movement(); int movement();
std::string ReadMQTT() std::string ReadMQTT();
MqttClient client("mqtt://localhost:1883", "KobukiRPI", "ishak", "kobuki");
void setup(){ void setup(){
unsigned char *null_ptr(0); unsigned char *null_ptr(0);
robot.startCommunication("/dev/ttyUSB0", true, null_ptr); robot.startCommunication("/dev/ttyUSB0", true, null_ptr);
MqttClient client("mqtt://localhost:1883", "KobukiRPI", "ishak", "kobuki");
client.connect(); client.connect();
client.subscribe("home/commands"); client.subscribe("home/commands");
} }
int main() int main()
setup();
{ {
readMQTT(); readMQTT();