RoboidControl-cpp/Things/TouchSensor.cpp
Pascal Serrarens a1a6941a28 Robot ant works
2025-03-04 16:01:55 +01:00

18 lines
494 B
C++

#include "TouchSensor.h"
namespace RoboidControl {
TouchSensor::TouchSensor(Participant* participant) : Thing(participant) {
this->touchedSomething = false;
this->type = (unsigned char)Thing::Type::TouchSensor;
}
void TouchSensor::GenerateBinary(char* bytes, unsigned char* ix) {}
void TouchSensor::ProcessBinary(char* bytes) {
if (bytes[0] == 1)
std::cout << this->name << " is Touching something!\n";
this->touchedSomething |= (bytes[0] == 1);
}
} // namespace RoboidControl