C#-Library to Interact with ESP-Remote Shockcollars
|
||
---|---|---|
.idea/.idea.CShocker/.idea | ||
CShocker | ||
TestApp | ||
.gitignore | ||
CShocker.sln | ||
CShocker.sln.DotSettings | ||
CShocker.sln.DotSettings.user | ||
LICENSE | ||
README.md |
Library to interact with Shock-Collars that are remotely controllable via ESP32-Boards.
Usage
public static void Main(string[] args){
IntensityRange intensityRange = new IntensityRange(30, 50);
DurationRange durationRange = new DurationRange(1000, 2000);
string apiKey = ":)";
OpenShockHttp openShockHttp = new (intensityRange, durationRange, apiKey);
OpenShockShocker shocker1 = openShockHttp.GetShockers().First();
shocker1.Control(ControlAction.Vibrate, 20, 1000);
shocker1.Dispose();
List<SerialPortInfo> serialPorts = SerialHelper.GetSerialPorts();
int selectedPort = 1;
OpenShockSerial openShockSerial = new(intensityRange, durationRange, serialPorts[selectedPort], apiKey);
OpenShockShocker shocker2 = openShockSerial.GetShockers().First();
shocker2.Control(ControlAction.Vibrate, 20, 1000);
shocker2.Dispose();
}
Shocker.Control
Control(ControlAction action, int? intensity = null, int? duration = null)
If intensity
or duration
are null
, a random value within the
configured range will be used.
ControlAction
From here
Variables
ApiKey
- For OpenShock (HTTP) get token here
Intensity Range
in percent
0-100
Duration Range
in ms
0-30000
OpenShock0-15000
PiShock
Future
Username (PiShockHttp only)
For PiShock (HTTP) get information here
Sharecode (PiShockHttp only)
For PiShock (HTTP) get information here