mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
Renamed folders for consistency, using sim/athena/shared schema (#27)
Rename the following folders: hal/lib/Athena -> hal/lib/athena hal/lib/Desktop -> hal/lib/sim hal/lib/Shared -> hal/lib/shared wpilibc/Athena -> wpilibc/athena wpilibc/simulation -> wpilibc/sim Windows users may need to run gradlew clean after updating.
This commit is contained in:
committed by
Peter Johnson
parent
54092378e9
commit
e71f454b9d
21
wpilibc/sim/src/simulation/SimDigitalInput.cpp
Normal file
21
wpilibc/sim/src/simulation/SimDigitalInput.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* SimDigitalInput.cpp
|
||||
*
|
||||
* Created on: May 28, 2014
|
||||
* Author: alex
|
||||
*/
|
||||
|
||||
#include "simulation/SimDigitalInput.h"
|
||||
#include "simulation/MainNode.h"
|
||||
|
||||
SimDigitalInput::SimDigitalInput(std::string topic) {
|
||||
sub = MainNode::Subscribe("~/simulator/" + topic, &SimDigitalInput::callback,
|
||||
this);
|
||||
std::cout << "Initialized ~/simulator/" + topic << std::endl;
|
||||
}
|
||||
|
||||
bool SimDigitalInput::Get() { return value; }
|
||||
|
||||
void SimDigitalInput::callback(const msgs::ConstBoolPtr& msg) {
|
||||
value = msg->data();
|
||||
}
|
||||
Reference in New Issue
Block a user