RoboidControl-cpp/Things/TouchSensor.cpp
2025-03-06 11:06:43 +01:00

21 lines
592 B
C++

#include "TouchSensor.h"
namespace RoboidControl {
TouchSensor::TouchSensor() : Thing(Thing::Type::TouchSensor) {}
TouchSensor::TouchSensor(Participant* participant)
: Thing(participant, Thing::Type::TouchSensor) {}
TouchSensor::TouchSensor(Thing* parent) : Thing(parent->owner) {
this->SetParent(parent);
}
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