Update Readme
This commit is contained in:
parent
978b384759
commit
4e79f40e80
10
README.md
10
README.md
@ -7,11 +7,9 @@ Library to interact with Shock-Collars that are remotely controllable via ESP32-
|
|||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
public static void Main(string[] args){
|
public static void Main(string[] args){
|
||||||
IntensityRange intensityRange = new IntensityRange(30, 50);
|
|
||||||
DurationRange durationRange = new DurationRange(1000, 2000);
|
|
||||||
string apiKey = ":)";
|
string apiKey = ":)";
|
||||||
|
|
||||||
OpenShockHttp openShockHttp = new (intensityRange, durationRange, apiKey);
|
OpenShockHttp openShockHttp = new (apiKey);
|
||||||
OpenShockShocker shocker1 = openShockHttp.GetShockers().First();
|
OpenShockShocker shocker1 = openShockHttp.GetShockers().First();
|
||||||
shocker1.Control(ControlAction.Vibrate, 20, 1000);
|
shocker1.Control(ControlAction.Vibrate, 20, 1000);
|
||||||
|
|
||||||
@ -19,7 +17,7 @@ public static void Main(string[] args){
|
|||||||
|
|
||||||
List<SerialPortInfo> serialPorts = SerialHelper.GetSerialPorts();
|
List<SerialPortInfo> serialPorts = SerialHelper.GetSerialPorts();
|
||||||
int selectedPort = 1;
|
int selectedPort = 1;
|
||||||
OpenShockSerial openShockSerial = new(intensityRange, durationRange, serialPorts[selectedPort], apiKey);
|
OpenShockSerial openShockSerial = new(serialPorts[selectedPort], apiKey);
|
||||||
OpenShockShocker shocker2 = openShockSerial.GetShockers().First();
|
OpenShockShocker shocker2 = openShockSerial.GetShockers().First();
|
||||||
shocker2.Control(ControlAction.Vibrate, 20, 1000);
|
shocker2.Control(ControlAction.Vibrate, 20, 1000);
|
||||||
|
|
||||||
@ -28,10 +26,8 @@ public static void Main(string[] args){
|
|||||||
```
|
```
|
||||||
## `Shocker.Control`
|
## `Shocker.Control`
|
||||||
```csharp
|
```csharp
|
||||||
Control(ControlAction action, int? intensity = null, int? duration = null)
|
Control(ControlAction action, int intensity, int duration)
|
||||||
```
|
```
|
||||||
If `intensity` or `duration` are `null`, a random value within the
|
|
||||||
configured range will be used.
|
|
||||||
|
|
||||||
|
|
||||||
### ControlAction
|
### ControlAction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user