Roboid Control for C++
Loading...
Searching...
No Matches
TouchSensor.h
1#pragma once
2
3#include "Thing.h"
4
5namespace RoboidControl {
6
8class TouchSensor : public Thing {
9// Why finishing this release (0.3), I notice that this is equivalent to a digital sensor
10 public:
17 TouchSensor(Participant* owner, unsigned char thingId = 0);
22 TouchSensor(Thing* parent, unsigned char thingId = 0);
23
26 bool touchedSomething = false;
27
31 int GenerateBinary(char* bytes, unsigned char* ix) override;
34 virtual void ProcessBinary(char* bytes) override;
35};
36
37} // namespace RoboidControl
A participant is a device which manages things. It can communicate with other participant to synchron...
Definition Participant.h:52
A thing is the primitive building block.
Definition Thing.h:20
Participant * owner
The participant managing this thing.
Definition Thing.h:74
A sensor which can detect touches.
Definition TouchSensor.h:8
int GenerateBinary(char *bytes, unsigned char *ix) override
Function used to generate binary data for this touch sensor.
Definition TouchSensor.cpp:14
bool touchedSomething
Value which is true when the sensor is touching something, false otherwise.
Definition TouchSensor.h:26
TouchSensor()
Create a touch sensor without communication abilities.
Definition TouchSensor.cpp:5
virtual void ProcessBinary(char *bytes) override
Function used to process binary data received for this touch sensor.
Definition TouchSensor.cpp:19