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 public:
13 TouchSensor(Participant* participant);
17 TouchSensor(Thing* parent);
18 // TouchSensor(RemoteParticipant* participant, unsigned char networkId,
19 // unsigned char thingId);
20
23 bool touchedSomething = false;
24
28 void GenerateBinary(char* bytes, unsigned char* ix) override;
31 virtual void ProcessBinary(char* bytes) override;
32};
33
34} // namespace RoboidControl
A participant is a device which manages things. It can communicate with other participant to synchron...
Definition Participant.h:14
A thing is the primitive building block.
Definition Thing.h:20
A sensor which can detect touches.
Definition TouchSensor.h:8
bool touchedSomething
Value which is true when the sensor is touching something, false otherwise.
Definition TouchSensor.h:23
void GenerateBinary(char *bytes, unsigned char *ix) override
Function to create a binary message with the temperature.
Definition TouchSensor.cpp:13
TouchSensor()
Create a touch sensor with isolated participant.
Definition TouchSensor.cpp:4
virtual void ProcessBinary(char *bytes) override
Function to extract the temperature received in the binary message.
Definition TouchSensor.cpp:15