diff --git a/.bonsai/Bonsai.config b/.bonsai/Bonsai.config index a2b4cf3..d9fd009 100644 --- a/.bonsai/Bonsai.config +++ b/.bonsai/Bonsai.config @@ -5,6 +5,7 @@ + @@ -27,12 +28,14 @@ + + diff --git a/docs/apidoc/Harp_Behavior.md b/docs/apidoc/Harp_Behavior.md new file mode 100644 index 0000000..a2a3119 --- /dev/null +++ b/docs/apidoc/Harp_Behavior.md @@ -0,0 +1,5 @@ +--- +uid: Harp.Behavior +--- + +[!include[RegisterTables](./Harp_Behavior_Device.md)] \ No newline at end of file diff --git a/docs/apidoc/Harp_Behavior_AnalogData.md b/docs/apidoc/Harp_Behavior_AnalogData.md new file mode 100644 index 0000000..f032bd0 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_AnalogData.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.AnalogData +--- + +### Visualize Analog Data + +:::workflow +![Visualize Analog Data](../workflows/acquireanalogdata-visualizedata.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Camera0Frame.md b/docs/apidoc/Harp_Behavior_Camera0Frame.md new file mode 100644 index 0000000..19a4e67 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Camera0Frame.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Camera0Frame +--- + +### Visualize Frame Events + +:::workflow +![Visualize Frame Events](../workflows/apidoc-camera0frame.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Camera0Frequency.md b/docs/apidoc/Harp_Behavior_Camera0Frequency.md new file mode 100644 index 0000000..4ead55d --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Camera0Frequency.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Camera0Frequency +--- + +### Configure Trigger Frequency + +:::workflow +![Configure Trigger Frequency](../workflows/apidoc-camera0frequency.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Camera1Frame.md b/docs/apidoc/Harp_Behavior_Camera1Frame.md new file mode 100644 index 0000000..8e1fee6 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Camera1Frame.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Camera1Frame +--- + +### Visualize Frame Events + +:::workflow +![Visualize Frame Events](../workflows/triggercameras-visualizeframes.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Camera1Frequency.md b/docs/apidoc/Harp_Behavior_Camera1Frequency.md new file mode 100644 index 0000000..27985e5 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Camera1Frequency.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Camera1Frequency +--- + +### Configure Trigger Frequency + +:::workflow +![Configure Trigger Frequency](../workflows/triggercameras-frequency.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateCamera0FrequencyPayload.md b/docs/apidoc/Harp_Behavior_CreateCamera0FrequencyPayload.md new file mode 100644 index 0000000..3af6780 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateCamera0FrequencyPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateCamera0FrequencyPayload +--- + +### Configure Trigger Frequency + +:::workflow +![Configure Trigger Frequency](../workflows/apidoc-camera0frequency.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateCamera1FrequencyPayload.md b/docs/apidoc/Harp_Behavior_CreateCamera1FrequencyPayload.md new file mode 100644 index 0000000..d2b8c1d --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateCamera1FrequencyPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateCamera1FrequencyPayload +--- + +### Configure Trigger Frequency + +:::workflow +![Configure Trigger Frequency](../workflows/triggercameras-frequency.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateDisableServosPayload.md b/docs/apidoc/Harp_Behavior_CreateDisableServosPayload.md new file mode 100644 index 0000000..71a18c7 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateDisableServosPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateDisableServosPayload +--- + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEnableEncodersPayload.md b/docs/apidoc/Harp_Behavior_CreateEnableEncodersPayload.md new file mode 100644 index 0000000..afee4f5 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEnableEncodersPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEnableEncodersPayload +--- + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotaryencoder-enable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEnableSerialTimestampPayload.md b/docs/apidoc/Harp_Behavior_CreateEnableSerialTimestampPayload.md new file mode 100644 index 0000000..8c52069 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEnableSerialTimestampPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEnableSerialTimestampPayload +--- + +### Stream Timestamps + +:::workflow +![Stream Timestamps](../workflows/advancedconfiguration-serialtimestamp.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEnableServosPayload.md b/docs/apidoc/Harp_Behavior_CreateEnableServosPayload.md new file mode 100644 index 0000000..2593876 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEnableServosPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEnableServosPayload +--- + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEncoderModePayload.md b/docs/apidoc/Harp_Behavior_CreateEncoderModePayload.md new file mode 100644 index 0000000..231f6cd --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEncoderModePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEncoderModePayload +--- + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotaryencoder-enable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEncoderResetPayload.md b/docs/apidoc/Harp_Behavior_CreateEncoderResetPayload.md new file mode 100644 index 0000000..59fbdb1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEncoderResetPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEncoderResetPayload +--- + +### Reset the Encoder + +:::workflow +![Reset the Encoder](../workflows/trackrotaryencoder-reset.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEventEnablePayload.md b/docs/apidoc/Harp_Behavior_CreateEventEnablePayload.md new file mode 100644 index 0000000..6892c4b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEventEnablePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEventEnablePayload +--- + +### Select Active Events + +:::workflow +![Select Active Events](../workflows/advancedconfiguration-eventenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateLed0CurrentPayload.md b/docs/apidoc/Harp_Behavior_CreateLed0CurrentPayload.md new file mode 100644 index 0000000..9c74fb2 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateLed0CurrentPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateLed0CurrentPayload +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/controlleds-current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateLed0MaxCurrentPayload.md b/docs/apidoc/Harp_Behavior_CreateLed0MaxCurrentPayload.md new file mode 100644 index 0000000..a22801b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateLed0MaxCurrentPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateLed0MaxCurrentPayload +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/controlleds-current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateLed1CurrentPayload.md b/docs/apidoc/Harp_Behavior_CreateLed1CurrentPayload.md new file mode 100644 index 0000000..2466503 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateLed1CurrentPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateLed1CurrentPayload +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/apidoc-led1current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateLed1MaxCurrentPayload.md b/docs/apidoc/Harp_Behavior_CreateLed1MaxCurrentPayload.md new file mode 100644 index 0000000..f26c8f2 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateLed1MaxCurrentPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateLed1MaxCurrentPayload +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/apidoc-led1current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateMimicPort0IRPayload.md b/docs/apidoc/Harp_Behavior_CreateMimicPort0IRPayload.md new file mode 100644 index 0000000..3672652 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateMimicPort0IRPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateMimicPort0IRPayload +--- + +### Mimic Poke Inputs + +:::workflow +![Mimic Poke Inputs](../workflows/mimicpokesignals-mimicir.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateMimicPort0ValvePayload.md b/docs/apidoc/Harp_Behavior_CreateMimicPort0ValvePayload.md new file mode 100644 index 0000000..94e7ffb --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateMimicPort0ValvePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateMimicPort0ValvePayload +--- + +### Mimic Poke Valves + +:::workflow +![Mimic Poke Valves](../workflows/mimicpokesignals-mimicvalve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateMimicPort1IRPayload.md b/docs/apidoc/Harp_Behavior_CreateMimicPort1IRPayload.md new file mode 100644 index 0000000..06b437b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateMimicPort1IRPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateMimicPort1IRPayload +--- + +### Mimic Poke Inputs + +:::workflow +![Mimic Poke Inputs](../workflows/apidoc-mimicport1ir.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateMimicPort1ValvePayload.md b/docs/apidoc/Harp_Behavior_CreateMimicPort1ValvePayload.md new file mode 100644 index 0000000..c454289 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateMimicPort1ValvePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateMimicPort1ValvePayload +--- + +### Mimic Poke Valves + +:::workflow +![Mimic Poke Valves](../workflows/apidoc-mimicport1valve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateMimicPort2IRPayload.md b/docs/apidoc/Harp_Behavior_CreateMimicPort2IRPayload.md new file mode 100644 index 0000000..ec4484f --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateMimicPort2IRPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateMimicPort2IRPayload +--- + +### Mimic Poke Inputs + +:::workflow +![Mimic Poke Inputs](../workflows/apidoc-mimicport2ir.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateMimicPort2ValvePayload.md b/docs/apidoc/Harp_Behavior_CreateMimicPort2ValvePayload.md new file mode 100644 index 0000000..f90d8e8 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateMimicPort2ValvePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateMimicPort2ValvePayload +--- + +### Mimic Poke Valves + +:::workflow +![Mimic Poke Valves](../workflows/apidoc-mimicport2valve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputClearPayload.md b/docs/apidoc/Harp_Behavior_CreateOutputClearPayload.md new file mode 100644 index 0000000..01a263d --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputClearPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateOutputClearPayload +--- + +### Set and Clear Outputs + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputPulseEnablePayload.md b/docs/apidoc/Harp_Behavior_CreateOutputPulseEnablePayload.md new file mode 100644 index 0000000..a18d20f --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputPulseEnablePayload.md @@ -0,0 +1,17 @@ +--- +uid: Harp.Behavior.CreateOutputPulseEnablePayload +--- + +[!INCLUDE [](../articles/outputpulseenable-warning.md)] + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: + +### Generate PWM Bursts + +:::workflow +![Generate PWM Bursts](../workflows/generatepwm-pulseenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputSetPayload.md b/docs/apidoc/Harp_Behavior_CreateOutputSetPayload.md new file mode 100644 index 0000000..f2c9461 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputSetPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateOutputSetPayload +--- + +### Set and Clear Outputs + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputStatePayload.md b/docs/apidoc/Harp_Behavior_CreateOutputStatePayload.md new file mode 100644 index 0000000..8ae4dc8 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputStatePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateOutputStatePayload +--- + +### Write All Outputs + +:::workflow +![Write All Outputs](../workflows/controldigitaloutputs-state.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputTogglePayload.md b/docs/apidoc/Harp_Behavior_CreateOutputTogglePayload.md new file mode 100644 index 0000000..6817861 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputTogglePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateOutputTogglePayload +--- + +### Toggle Outputs + +:::workflow +![Toggle Outputs](../workflows/controldigitaloutputs-toggle.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePokeInputFilterPayload.md b/docs/apidoc/Harp_Behavior_CreatePokeInputFilterPayload.md new file mode 100644 index 0000000..0d16be9 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePokeInputFilterPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePokeInputFilterPayload +--- + +### Configure Input Filter + +:::workflow +![Configure Input Filter](../workflows/controlpoke-inputfilter.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseDO0Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseDO0Payload.md new file mode 100644 index 0000000..7dec333 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseDO0Payload.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.CreatePulseDO0Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: + +### Generate PWM Bursts + +:::workflow +![Generate PWM Bursts](../workflows/generatepwm-pulseenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseDO1Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseDO1Payload.md new file mode 100644 index 0000000..04054ce --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseDO1Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseDO1Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedo1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseDO2Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseDO2Payload.md new file mode 100644 index 0000000..752ff83 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseDO2Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseDO2Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedo2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseDO3Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseDO3Payload.md new file mode 100644 index 0000000..54a3702 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseDO3Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseDO3Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedo3.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseDOPort0Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseDOPort0Payload.md new file mode 100644 index 0000000..3759a6f --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseDOPort0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseDOPort0Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedoport0.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseDOPort1Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseDOPort1Payload.md new file mode 100644 index 0000000..861288e --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseDOPort1Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseDOPort1Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedoport1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseDOPort2Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseDOPort2Payload.md new file mode 100644 index 0000000..2939b28 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseDOPort2Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseDOPort2Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedoport2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseLed0Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseLed0Payload.md new file mode 100644 index 0000000..29b6e4a --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseLed0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseLed0Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulseled0.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseLed1Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseLed1Payload.md new file mode 100644 index 0000000..08763cd --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseLed1Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseLed1Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulseled1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseRgb0Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseRgb0Payload.md new file mode 100644 index 0000000..5e5a422 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseRgb0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseRgb0Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsergb0.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseRgb1Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseRgb1Payload.md new file mode 100644 index 0000000..0e13f95 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseRgb1Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseRgb1Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsergb1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort0Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort0Payload.md new file mode 100644 index 0000000..01b1103 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseSupplyPort0Payload +--- + +### Deliver Rewards + +:::workflow +![Deliver Rewards](../workflows/controlpoke-valve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort1Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort1Payload.md new file mode 100644 index 0000000..33d4295 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort1Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseSupplyPort1Payload +--- + +### Deliver Rewards + +:::workflow +![Deliver Rewards](../workflows/apidoc-pulsesupplyport1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort2Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort2Payload.md new file mode 100644 index 0000000..a1dcddb --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort2Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseSupplyPort2Payload +--- + +### Deliver Rewards + +:::workflow +![Deliver Rewards](../workflows/apidoc-pulsesupplyport2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO0Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO0Payload.md new file mode 100644 index 0000000..869d266 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmDutyCycleDO0Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO1Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO1Payload.md new file mode 100644 index 0000000..9f68418 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO1Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmDutyCycleDO1Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO2Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO2Payload.md new file mode 100644 index 0000000..f1f33e1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO2Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmDutyCycleDO2Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO3Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO3Payload.md new file mode 100644 index 0000000..71bf27a --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO3Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmDutyCycleDO3Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo3.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO0Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO0Payload.md new file mode 100644 index 0000000..14645f1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmFrequencyDO0Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO1Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO1Payload.md new file mode 100644 index 0000000..53f85f0 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO1Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmFrequencyDO1Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO2Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO2Payload.md new file mode 100644 index 0000000..74ece9f --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO2Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmFrequencyDO2Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO3Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO3Payload.md new file mode 100644 index 0000000..cd67bd2 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO3Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmFrequencyDO3Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo3.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmStartPayload.md b/docs/apidoc/Harp_Behavior_CreatePwmStartPayload.md new file mode 100644 index 0000000..3aa0cb3 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmStartPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmStartPayload +--- + +### Start and Stop PWM + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmStopPayload.md b/docs/apidoc/Harp_Behavior_CreatePwmStopPayload.md new file mode 100644 index 0000000..97413a3 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmStopPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmStopPayload +--- + +### Start and Stop PWM + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateRgb0Payload.md b/docs/apidoc/Harp_Behavior_CreateRgb0Payload.md new file mode 100644 index 0000000..e44e44b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateRgb0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateRgb0Payload +--- + +### Set RGB Colors + +:::workflow +![Set RGB Colors](../workflows/apidoc-rgb0.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateRgb1Payload.md b/docs/apidoc/Harp_Behavior_CreateRgb1Payload.md new file mode 100644 index 0000000..f8bd0b2 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateRgb1Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateRgb1Payload +--- + +### Set RGB Colors + +:::workflow +![Set RGB Colors](../workflows/apidoc-rgb1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateRgbAllPayload.md b/docs/apidoc/Harp_Behavior_CreateRgbAllPayload.md new file mode 100644 index 0000000..a417cad --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateRgbAllPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateRgbAllPayload +--- + +### Set RGB Colors + +:::workflow +![Set RGB Colors](../workflows/controlleds-rgbcolors.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateServoMotor2PeriodPayload.md b/docs/apidoc/Harp_Behavior_CreateServoMotor2PeriodPayload.md new file mode 100644 index 0000000..13a3221 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateServoMotor2PeriodPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateServoMotor2PeriodPayload +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateServoMotor2PulsePayload.md b/docs/apidoc/Harp_Behavior_CreateServoMotor2PulsePayload.md new file mode 100644 index 0000000..0e72f03 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateServoMotor2PulsePayload.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.CreateServoMotor2PulsePayload +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: + +### Adjust the Position + +:::workflow +![Adjust the Position](../workflows/driveservos-position.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateServoMotor3PeriodPayload.md b/docs/apidoc/Harp_Behavior_CreateServoMotor3PeriodPayload.md new file mode 100644 index 0000000..9c8fa64 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateServoMotor3PeriodPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateServoMotor3PeriodPayload +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/apidoc-servomotor3period.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateServoMotor3PulsePayload.md b/docs/apidoc/Harp_Behavior_CreateServoMotor3PulsePayload.md new file mode 100644 index 0000000..0c77ff8 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateServoMotor3PulsePayload.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.CreateServoMotor3PulsePayload +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/apidoc-servomotor3period.bonsai) +::: + +### Adjust the Position + +:::workflow +![Adjust the Position](../workflows/apidoc-servomotor3pulse.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateStartCamerasPayload.md b/docs/apidoc/Harp_Behavior_CreateStartCamerasPayload.md new file mode 100644 index 0000000..8418f22 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateStartCamerasPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateStartCamerasPayload +--- + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateStopCamerasPayload.md b/docs/apidoc/Harp_Behavior_CreateStopCamerasPayload.md new file mode 100644 index 0000000..d719d26 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateStopCamerasPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateStopCamerasPayload +--- + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Device.md b/docs/apidoc/Harp_Behavior_Device.md new file mode 100644 index 0000000..2901e13 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Device.md @@ -0,0 +1,109 @@ +--- +uid: Harp.Behavior.Device +--- + +Use the [Harp device pattern](https://harp-tech.org/articles/operators.html#device-pattern) to initialize the device, log data, and send commands to and receive messages from the Behavior board. + +:::workflow +![Harp Device Pattern](../workflows/harp-devicepattern.bonsai) +::: + +Check out the following in-depth guides to learn how to access the device functionality with the `Harp.Behavior` package: + +- [Acquire Analog Data](../articles/acquire-analog-data.md) +- [Read Digital Inputs](../articles/read-digital-inputs.md) +- [Control Digital Outputs](../articles/control-digital-outputs.md) +- [Generate PWM](../articles/generate-pwm.md) +- [Control LEDs](../articles/control-leds.md) +- [Control Poke Peripheral](../articles/control-poke.md) +- [Mimic Poke Signals](../articles/mimic-poke-signals.md) +- [Track Rotary Encoder](../articles/track-rotary-encoder.md) +- [Trigger Cameras](../articles/trigger-cameras.md) +- [Drive Servos](../articles/drive-servos.md) +- [Advanced Configuration](../articles/advanced-configuration.md) + +Refer to the register table below for a complete listing of the available registers on the device. + + + + + + + + + + +
Behavior
whoAmI1216
firmwareVersion3.4
hardwareTargets2.0
+ +### Registers + +| name | address | type | length | access | description | range | interfaceType | +|-|-|-|-|-|-|-|-| +| [DigitalInputState](xref:Harp.Behavior.DigitalInputState) | 32 | U8 | | Event | Reflects the state of DI digital lines of each Port | | [DigitalInputs](xref:Harp.Behavior.DigitalInputs) | +| [OutputSet](xref:Harp.Behavior.OutputSet) | 34 | U16 | | Write | Set the specified digital output lines. | | [DigitalOutputs](xref:Harp.Behavior.DigitalOutputs) | +| [OutputClear](xref:Harp.Behavior.OutputClear) | 35 | U16 | | Write | Clear the specified digital output lines | | [DigitalOutputs](xref:Harp.Behavior.DigitalOutputs) | +| [OutputToggle](xref:Harp.Behavior.OutputToggle) | 36 | U16 | | Write | Toggle the specified digital output lines | | [DigitalOutputs](xref:Harp.Behavior.DigitalOutputs) | +| [OutputState](xref:Harp.Behavior.OutputState) | 37 | U16 | | Write | Write the state of all digital output lines | | [DigitalOutputs](xref:Harp.Behavior.DigitalOutputs) | +| [PortDIOSet](xref:Harp.Behavior.PortDIOSet) | 38 | U8 | | Write | Set the specified port DIO lines | | [PortDigitalIOS](xref:Harp.Behavior.PortDigitalIOS) | +| [PortDIOClear](xref:Harp.Behavior.PortDIOClear) | 39 | U8 | | Write | Clear the specified port DIO lines | | [PortDigitalIOS](xref:Harp.Behavior.PortDigitalIOS) | +| [PortDIOToggle](xref:Harp.Behavior.PortDIOToggle) | 40 | U8 | | Write | Toggle the specified port DIO lines | | [PortDigitalIOS](xref:Harp.Behavior.PortDigitalIOS) | +| [PortDIOState](xref:Harp.Behavior.PortDIOState) | 41 | U8 | | Write | Write the state of all port DIO lines | | [PortDigitalIOS](xref:Harp.Behavior.PortDigitalIOS) | +| [PortDIODirection](xref:Harp.Behavior.PortDIODirection) | 42 | U8 | | Write | Specifies which of the port DIO lines are outputs | | [PortDigitalIOS](xref:Harp.Behavior.PortDigitalIOS) | +| [PortDIOStateEvent](xref:Harp.Behavior.PortDIOStateEvent) | 43 | U8 | | Event | Specifies the state of the port DIO lines on a line change | | [PortDigitalIOS](xref:Harp.Behavior.PortDigitalIOS) | +| [AnalogData](xref:Harp.Behavior.AnalogData) | 44 | S16 | 3 | Event | Voltage at the ADC input and encoder value on Port 2 | | [AnalogDataPayload](xref:Harp.Behavior.AnalogDataPayload) | +| [OutputPulseEnable](xref:Harp.Behavior.OutputPulseEnable) | 45 | U16 | | Write | Enables the pulse function for the specified output lines | | [DigitalOutputs](xref:Harp.Behavior.DigitalOutputs) | +| [PulseDOPort0](xref:Harp.Behavior.PulseDOPort0) | 46 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseDOPort1](xref:Harp.Behavior.PulseDOPort1) | 47 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseDOPort2](xref:Harp.Behavior.PulseDOPort2) | 48 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseSupplyPort0](xref:Harp.Behavior.PulseSupplyPort0) | 49 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseSupplyPort1](xref:Harp.Behavior.PulseSupplyPort1) | 50 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseSupplyPort2](xref:Harp.Behavior.PulseSupplyPort2) | 51 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseLed0](xref:Harp.Behavior.PulseLed0) | 52 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseLed1](xref:Harp.Behavior.PulseLed1) | 53 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseRgb0](xref:Harp.Behavior.PulseRgb0) | 54 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseRgb1](xref:Harp.Behavior.PulseRgb1) | 55 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseDO0](xref:Harp.Behavior.PulseDO0) | 56 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseDO1](xref:Harp.Behavior.PulseDO1) | 57 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseDO2](xref:Harp.Behavior.PulseDO2) | 58 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PulseDO3](xref:Harp.Behavior.PulseDO3) | 59 | U16 | | Write | Specifies the duration of the output pulse in milliseconds. | [1:] | | +| [PwmFrequencyDO0](xref:Harp.Behavior.PwmFrequencyDO0) | 60 | U16 | | Write | Specifies the frequency of the PWM at DO0. | [1:] | | +| [PwmFrequencyDO1](xref:Harp.Behavior.PwmFrequencyDO1) | 61 | U16 | | Write | Specifies the frequency of the PWM at DO1. | [1:] | | +| [PwmFrequencyDO2](xref:Harp.Behavior.PwmFrequencyDO2) | 62 | U16 | | Write | Specifies the frequency of the PWM at DO2. | [1:] | | +| [PwmFrequencyDO3](xref:Harp.Behavior.PwmFrequencyDO3) | 63 | U16 | | Write | Specifies the frequency of the PWM at DO3. | [1:] | | +| [PwmDutyCycleDO0](xref:Harp.Behavior.PwmDutyCycleDO0) | 64 | U8 | | Write | Specifies the duty cycle of the PWM at DO0. | [1:99] | | +| [PwmDutyCycleDO1](xref:Harp.Behavior.PwmDutyCycleDO1) | 65 | U8 | | Write | Specifies the duty cycle of the PWM at DO1. | [1:99] | | +| [PwmDutyCycleDO2](xref:Harp.Behavior.PwmDutyCycleDO2) | 66 | U8 | | Write | Specifies the duty cycle of the PWM at DO2. | [1:99] | | +| [PwmDutyCycleDO3](xref:Harp.Behavior.PwmDutyCycleDO3) | 67 | U8 | | Write | Specifies the duty cycle of the PWM at DO3. | [1:99] | | +| [PwmStart](xref:Harp.Behavior.PwmStart) | 68 | U8 | | Write | Starts the PWM on the selected output lines. | | [PwmOutputs](xref:Harp.Behavior.PwmOutputs) | +| [PwmStop](xref:Harp.Behavior.PwmStop) | 69 | U8 | | Write | Stops the PWM on the selected output lines. | | [PwmOutputs](xref:Harp.Behavior.PwmOutputs) | +| [RgbAll](xref:Harp.Behavior.RgbAll) | 70 | U8 | 6 | Write | Specifies the state of all RGB LED channels. | | [RgbAllPayload](xref:Harp.Behavior.RgbAllPayload) | +| [Rgb0](xref:Harp.Behavior.Rgb0) | 71 | U8 | 3 | Write | Specifies the state of the RGB0 LED channels. | | [RgbPayload](xref:Harp.Behavior.RgbPayload) | +| [Rgb1](xref:Harp.Behavior.Rgb1) | 72 | U8 | 3 | Write | Specifies the state of the RGB1 LED channels. | | [RgbPayload](xref:Harp.Behavior.RgbPayload) | +| [Led0Current](xref:Harp.Behavior.Led0Current) | 73 | U8 | | Write | Specifies the configuration of current to drive LED 0. | [2:100] | | +| [Led1Current](xref:Harp.Behavior.Led1Current) | 74 | U8 | | Write | Specifies the configuration of current to drive LED 1. | [2:100] | | +| [Led0MaxCurrent](xref:Harp.Behavior.Led0MaxCurrent) | 75 | U8 | | Write | Specifies the configuration of current to drive LED 0. | [5:100] | | +| [Led1MaxCurrent](xref:Harp.Behavior.Led1MaxCurrent) | 76 | U8 | | Write | Specifies the configuration of current to drive LED 1. | [5:100] | | +| [EventEnable](xref:Harp.Behavior.EventEnable) | 77 | U8 | | Write | Specifies the active events in the device. | | [Events](xref:Harp.Behavior.Events) | +| [StartCameras](xref:Harp.Behavior.StartCameras) | 78 | U8 | | Write | Specifies the camera outputs to enable in the device. | | [CameraOutputs](xref:Harp.Behavior.CameraOutputs) | +| [StopCameras](xref:Harp.Behavior.StopCameras) | 79 | U8 | | Write, Event | Specifies the camera outputs to disable in the device. An event will be issued when the trigger signal is actually stopped being generated. | | [CameraOutputs](xref:Harp.Behavior.CameraOutputs) | +| [EnableServos](xref:Harp.Behavior.EnableServos) | 80 | U8 | | Write | Specifies the servo outputs to enable in the device. | | [ServoOutputs](xref:Harp.Behavior.ServoOutputs) | +| [DisableServos](xref:Harp.Behavior.DisableServos) | 81 | U8 | | Write | Specifies the servo outputs to disable in the device. | | [ServoOutputs](xref:Harp.Behavior.ServoOutputs) | +| [EnableEncoders](xref:Harp.Behavior.EnableEncoders) | 82 | U8 | | Write | Specifies the port quadrature counters to enable in the device. | | [EncoderInputs](xref:Harp.Behavior.EncoderInputs) | +| [EncoderMode](xref:Harp.Behavior.EncoderMode) | 83 | U8 | | Write | Configures the operation mode of the quadrature encoders. | | [EncoderModeMask](xref:Harp.Behavior.EncoderModeMask) | +| [Camera0Frame](xref:Harp.Behavior.Camera0Frame) | 92 | U8 | | Event | Specifies that a frame was acquired on camera 0. | | [FrameAcquired](xref:Harp.Behavior.FrameAcquired) | +| [Camera0Frequency](xref:Harp.Behavior.Camera0Frequency) | 93 | U16 | | Write | Specifies the trigger frequency for camera 0. | [1:600] | | +| [Camera1Frame](xref:Harp.Behavior.Camera1Frame) | 94 | U8 | | Event | Specifies that a frame was acquired on camera 1. | | [FrameAcquired](xref:Harp.Behavior.FrameAcquired) | +| [Camera1Frequency](xref:Harp.Behavior.Camera1Frequency) | 95 | U16 | | Write | Specifies the trigger frequency for camera 1. | [1:600] | | +| [ServoMotor2Period](xref:Harp.Behavior.ServoMotor2Period) | 100 | U16 | | Write | Specifies the period of the servo motor in DO2, in microseconds. | [2:65534] | | +| [ServoMotor2Pulse](xref:Harp.Behavior.ServoMotor2Pulse) | 101 | U16 | | Write | Specifies the pulse of the servo motor in DO2, in microseconds. | [6:65530] | | +| [ServoMotor3Period](xref:Harp.Behavior.ServoMotor3Period) | 102 | U16 | | Write | Specifies the period of the servo motor in DO3, in microseconds. | [2:65534] | | +| [ServoMotor3Pulse](xref:Harp.Behavior.ServoMotor3Pulse) | 103 | U16 | | Write | Specifies the pulse of the servo motor in DO3, in microseconds. | [6:65530] | | +| [EncoderReset](xref:Harp.Behavior.EncoderReset) | 108 | U8 | | Write | Reset the counter of the specified encoders to zero. | | [EncoderInputs](xref:Harp.Behavior.EncoderInputs) | +| [EnableSerialTimestamp](xref:Harp.Behavior.EnableSerialTimestamp) | 110 | U8 | | Write | Enables the timestamp for serial TX. | | [SerialTimestampPorts](xref:Harp.Behavior.SerialTimestampPorts) | +| [MimicPort0IR](xref:Harp.Behavior.MimicPort0IR) | 111 | U8 | | Write | Specifies the digital output to mimic the Port 0 IR state. | | [MimicOutput](xref:Harp.Behavior.MimicOutput) | +| [MimicPort1IR](xref:Harp.Behavior.MimicPort1IR) | 112 | U8 | | Write | Specifies the digital output to mimic the Port 1 IR state. | | [MimicOutput](xref:Harp.Behavior.MimicOutput) | +| [MimicPort2IR](xref:Harp.Behavior.MimicPort2IR) | 113 | U8 | | Write | Specifies the digital output to mimic the Port 2 IR state. | | [MimicOutput](xref:Harp.Behavior.MimicOutput) | +| [MimicPort0Valve](xref:Harp.Behavior.MimicPort0Valve) | 117 | U8 | | Write | Specifies the digital output to mimic the Port 0 valve state. | | [MimicOutput](xref:Harp.Behavior.MimicOutput) | +| [MimicPort1Valve](xref:Harp.Behavior.MimicPort1Valve) | 118 | U8 | | Write | Specifies the digital output to mimic the Port 1 valve state. | | [MimicOutput](xref:Harp.Behavior.MimicOutput) | +| [MimicPort2Valve](xref:Harp.Behavior.MimicPort2Valve) | 119 | U8 | | Write | Specifies the digital output to mimic the Port 2 valve state. | | [MimicOutput](xref:Harp.Behavior.MimicOutput) | +| [PokeInputFilter](xref:Harp.Behavior.PokeInputFilter) | 122 | U8 | | Write | Specifies the low pass filter time value for poke inputs, in ms. | | | diff --git a/docs/apidoc/Harp_Behavior_DeviceDataWriter.md b/docs/apidoc/Harp_Behavior_DeviceDataWriter.md new file mode 100644 index 0000000..54e7473 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_DeviceDataWriter.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.DeviceDataWriter +--- + +### Harp Device Pattern + +:::workflow +![Harp Device Pattern](../workflows/harp-devicepattern.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_DigitalInputState.md b/docs/apidoc/Harp_Behavior_DigitalInputState.md new file mode 100644 index 0000000..38f2bba --- /dev/null +++ b/docs/apidoc/Harp_Behavior_DigitalInputState.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.DigitalInputState +--- + +### Visualize Poke Events + +:::workflow +![Visualize Poke Events](../workflows/controlpoke-visualizeevents.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_DisableServos.md b/docs/apidoc/Harp_Behavior_DisableServos.md new file mode 100644 index 0000000..5f2c0c4 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_DisableServos.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.DisableServos +--- + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EnableEncoders.md b/docs/apidoc/Harp_Behavior_EnableEncoders.md new file mode 100644 index 0000000..dd80d4c --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EnableEncoders.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EnableEncoders +--- + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotaryencoder-enable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EnableSerialTimestamp.md b/docs/apidoc/Harp_Behavior_EnableSerialTimestamp.md new file mode 100644 index 0000000..0fb26c6 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EnableSerialTimestamp.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EnableSerialTimestamp +--- + +### Stream Timestamps + +:::workflow +![Stream Timestamps](../workflows/advancedconfiguration-serialtimestamp.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EnableServos.md b/docs/apidoc/Harp_Behavior_EnableServos.md new file mode 100644 index 0000000..017d431 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EnableServos.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EnableServos +--- + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EncoderMode.md b/docs/apidoc/Harp_Behavior_EncoderMode.md new file mode 100644 index 0000000..6ee5b83 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EncoderMode.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EncoderMode +--- + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotaryencoder-enable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EncoderReset.md b/docs/apidoc/Harp_Behavior_EncoderReset.md new file mode 100644 index 0000000..987ab1b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EncoderReset.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EncoderReset +--- + +### Reset the Encoder + +:::workflow +![Reset the Encoder](../workflows/trackrotaryencoder-reset.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EventEnable.md b/docs/apidoc/Harp_Behavior_EventEnable.md new file mode 100644 index 0000000..865a2d0 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EventEnable.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EventEnable +--- + +### Select Active Events + +:::workflow +![Select Active Events](../workflows/advancedconfiguration-eventenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Led0Current.md b/docs/apidoc/Harp_Behavior_Led0Current.md new file mode 100644 index 0000000..2d33cb3 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Led0Current.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Led0Current +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/controlleds-current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Led0MaxCurrent.md b/docs/apidoc/Harp_Behavior_Led0MaxCurrent.md new file mode 100644 index 0000000..e73f9df --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Led0MaxCurrent.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Led0MaxCurrent +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/controlleds-current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Led1Current.md b/docs/apidoc/Harp_Behavior_Led1Current.md new file mode 100644 index 0000000..68f873f --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Led1Current.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Led1Current +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/apidoc-led1current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Led1MaxCurrent.md b/docs/apidoc/Harp_Behavior_Led1MaxCurrent.md new file mode 100644 index 0000000..ae3fd0b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Led1MaxCurrent.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Led1MaxCurrent +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/apidoc-led1current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_MimicPort0IR.md b/docs/apidoc/Harp_Behavior_MimicPort0IR.md new file mode 100644 index 0000000..a3de553 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_MimicPort0IR.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.MimicPort0IR +--- + +### Mimic Poke Inputs + +:::workflow +![Mimic Poke Inputs](../workflows/mimicpokesignals-mimicir.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_MimicPort0Valve.md b/docs/apidoc/Harp_Behavior_MimicPort0Valve.md new file mode 100644 index 0000000..f52e7e0 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_MimicPort0Valve.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.MimicPort0Valve +--- + +### Mimic Poke Valves + +:::workflow +![Mimic Poke Valves](../workflows/mimicpokesignals-mimicvalve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_MimicPort1IR.md b/docs/apidoc/Harp_Behavior_MimicPort1IR.md new file mode 100644 index 0000000..9708585 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_MimicPort1IR.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.MimicPort1IR +--- + +### Mimic Poke Inputs + +:::workflow +![Mimic Poke Inputs](../workflows/apidoc-mimicport1ir.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_MimicPort1Valve.md b/docs/apidoc/Harp_Behavior_MimicPort1Valve.md new file mode 100644 index 0000000..537474e --- /dev/null +++ b/docs/apidoc/Harp_Behavior_MimicPort1Valve.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.MimicPort1Valve +--- + +### Mimic Poke Valves + +:::workflow +![Mimic Poke Valves](../workflows/apidoc-mimicport1valve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_MimicPort2IR.md b/docs/apidoc/Harp_Behavior_MimicPort2IR.md new file mode 100644 index 0000000..40a8474 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_MimicPort2IR.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.MimicPort2IR +--- + +### Mimic Poke Inputs + +:::workflow +![Mimic Poke Inputs](../workflows/apidoc-mimicport2ir.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_MimicPort2Valve.md b/docs/apidoc/Harp_Behavior_MimicPort2Valve.md new file mode 100644 index 0000000..080959e --- /dev/null +++ b/docs/apidoc/Harp_Behavior_MimicPort2Valve.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.MimicPort2Valve +--- + +### Mimic Poke Valves + +:::workflow +![Mimic Poke Valves](../workflows/apidoc-mimicport2valve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_OutputClear.md b/docs/apidoc/Harp_Behavior_OutputClear.md new file mode 100644 index 0000000..696cc23 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputClear.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.OutputClear +--- + +### Set and Clear Outputs + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_OutputPulseEnable.md b/docs/apidoc/Harp_Behavior_OutputPulseEnable.md new file mode 100644 index 0000000..f49a806 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputPulseEnable.md @@ -0,0 +1,11 @@ +--- +uid: Harp.Behavior.OutputPulseEnable +--- + +[!INCLUDE [](../articles/outputpulseenable-warning.md)] + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: \ No newline at end of file diff --git a/docs/apidoc/Harp_Behavior_OutputSet.md b/docs/apidoc/Harp_Behavior_OutputSet.md new file mode 100644 index 0000000..028d2bf --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputSet.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.OutputSet +--- + +### Set and Clear Outputs + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_OutputState.md b/docs/apidoc/Harp_Behavior_OutputState.md new file mode 100644 index 0000000..fe20cc7 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputState.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.OutputState +--- + +### Write All Outputs + +:::workflow +![Write All Outputs](../workflows/controldigitaloutputs-state.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_OutputToggle.md b/docs/apidoc/Harp_Behavior_OutputToggle.md new file mode 100644 index 0000000..9b494ab --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputToggle.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.OutputToggle +--- + +### Toggle Outputs + +:::workflow +![Toggle Outputs](../workflows/controldigitaloutputs-toggle.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PokeInputFilter.md b/docs/apidoc/Harp_Behavior_PokeInputFilter.md new file mode 100644 index 0000000..f3a0241 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PokeInputFilter.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PokeInputFilter +--- + +### Configure Input Filter + +:::workflow +![Configure Input Filter](../workflows/controlpoke-inputfilter.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseDO0.md b/docs/apidoc/Harp_Behavior_PulseDO0.md new file mode 100644 index 0000000..98964f1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseDO0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseDO0 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseDO1.md b/docs/apidoc/Harp_Behavior_PulseDO1.md new file mode 100644 index 0000000..3f1b89f --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseDO1.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseDO1 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedo1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseDO2.md b/docs/apidoc/Harp_Behavior_PulseDO2.md new file mode 100644 index 0000000..541dadc --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseDO2.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseDO2 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedo2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseDO3.md b/docs/apidoc/Harp_Behavior_PulseDO3.md new file mode 100644 index 0000000..5bec12f --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseDO3.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseDO3 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedo3.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseDOPort0.md b/docs/apidoc/Harp_Behavior_PulseDOPort0.md new file mode 100644 index 0000000..eb717c1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseDOPort0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseDOPort0 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedoport0.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseDOPort1.md b/docs/apidoc/Harp_Behavior_PulseDOPort1.md new file mode 100644 index 0000000..b9e9ad5 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseDOPort1.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseDOPort1 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedoport1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseDOPort2.md b/docs/apidoc/Harp_Behavior_PulseDOPort2.md new file mode 100644 index 0000000..275fdef --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseDOPort2.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseDOPort2 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsedoport2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseLed0.md b/docs/apidoc/Harp_Behavior_PulseLed0.md new file mode 100644 index 0000000..1aa68ff --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseLed0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseLed0 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulseled0.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseLed1.md b/docs/apidoc/Harp_Behavior_PulseLed1.md new file mode 100644 index 0000000..b6efa54 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseLed1.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseLed1 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulseled1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseRgb0.md b/docs/apidoc/Harp_Behavior_PulseRgb0.md new file mode 100644 index 0000000..ac08baa --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseRgb0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseRgb0 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsergb0.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseRgb1.md b/docs/apidoc/Harp_Behavior_PulseRgb1.md new file mode 100644 index 0000000..8f55595 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseRgb1.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseRgb1 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/apidoc-pulsergb1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseSupplyPort0.md b/docs/apidoc/Harp_Behavior_PulseSupplyPort0.md new file mode 100644 index 0000000..98d0554 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseSupplyPort0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseSupplyPort0 +--- + +### Deliver Rewards + +:::workflow +![Deliver Rewards](../workflows/controlpoke-valve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseSupplyPort1.md b/docs/apidoc/Harp_Behavior_PulseSupplyPort1.md new file mode 100644 index 0000000..b5da862 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseSupplyPort1.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseSupplyPort1 +--- + +### Deliver Rewards + +:::workflow +![Deliver Rewards](../workflows/apidoc-pulsesupplyport1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseSupplyPort2.md b/docs/apidoc/Harp_Behavior_PulseSupplyPort2.md new file mode 100644 index 0000000..20b6613 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseSupplyPort2.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseSupplyPort2 +--- + +### Deliver Rewards + +:::workflow +![Deliver Rewards](../workflows/apidoc-pulsesupplyport2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmDutyCycleDO0.md b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO0.md new file mode 100644 index 0000000..a84abf1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmDutyCycleDO0 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmDutyCycleDO1.md b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO1.md new file mode 100644 index 0000000..3659c33 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO1.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmDutyCycleDO1 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmDutyCycleDO2.md b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO2.md new file mode 100644 index 0000000..333d3d1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO2.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmDutyCycleDO2 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmDutyCycleDO3.md b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO3.md new file mode 100644 index 0000000..b7752bb --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO3.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmDutyCycleDO3 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo3.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmFrequencyDO0.md b/docs/apidoc/Harp_Behavior_PwmFrequencyDO0.md new file mode 100644 index 0000000..7b89e46 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmFrequencyDO0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmFrequencyDO0 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmFrequencyDO1.md b/docs/apidoc/Harp_Behavior_PwmFrequencyDO1.md new file mode 100644 index 0000000..53ec308 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmFrequencyDO1.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmFrequencyDO1 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmFrequencyDO2.md b/docs/apidoc/Harp_Behavior_PwmFrequencyDO2.md new file mode 100644 index 0000000..a046c6f --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmFrequencyDO2.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmFrequencyDO2 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo2.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmFrequencyDO3.md b/docs/apidoc/Harp_Behavior_PwmFrequencyDO3.md new file mode 100644 index 0000000..603a7a2 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmFrequencyDO3.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmFrequencyDO3 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/apidoc-pwmdo3.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmStart.md b/docs/apidoc/Harp_Behavior_PwmStart.md new file mode 100644 index 0000000..8098cf6 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmStart.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmStart +--- + +### Start and Stop PWM + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmStop.md b/docs/apidoc/Harp_Behavior_PwmStop.md new file mode 100644 index 0000000..50bf67e --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmStop.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmStop +--- + +### Start and Stop PWM + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Rgb0.md b/docs/apidoc/Harp_Behavior_Rgb0.md new file mode 100644 index 0000000..1ebccf7 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Rgb0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Rgb0 +--- + +### Set RGB Colors + +:::workflow +![Set RGB Colors](../workflows/apidoc-rgb0.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Rgb1.md b/docs/apidoc/Harp_Behavior_Rgb1.md new file mode 100644 index 0000000..0540346 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Rgb1.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Rgb1 +--- + +### Set RGB Colors + +:::workflow +![Set RGB Colors](../workflows/apidoc-rgb1.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_RgbAll.md b/docs/apidoc/Harp_Behavior_RgbAll.md new file mode 100644 index 0000000..09f7daa --- /dev/null +++ b/docs/apidoc/Harp_Behavior_RgbAll.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.RgbAll +--- + +### Set RGB Colors + +:::workflow +![Set RGB Colors](../workflows/controlleds-rgbcolors.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_ServoMotor2Period.md b/docs/apidoc/Harp_Behavior_ServoMotor2Period.md new file mode 100644 index 0000000..8b52717 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_ServoMotor2Period.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.ServoMotor2Period +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_ServoMotor2Pulse.md b/docs/apidoc/Harp_Behavior_ServoMotor2Pulse.md new file mode 100644 index 0000000..c19c925 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_ServoMotor2Pulse.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.ServoMotor2Pulse +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: + +### Adjust the Position + +:::workflow +![Adjust the Position](../workflows/driveservos-position.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_ServoMotor3Period.md b/docs/apidoc/Harp_Behavior_ServoMotor3Period.md new file mode 100644 index 0000000..9258c0d --- /dev/null +++ b/docs/apidoc/Harp_Behavior_ServoMotor3Period.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.ServoMotor3Period +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/apidoc-servomotor3period.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_ServoMotor3Pulse.md b/docs/apidoc/Harp_Behavior_ServoMotor3Pulse.md new file mode 100644 index 0000000..5f7013b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_ServoMotor3Pulse.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.ServoMotor3Pulse +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/apidoc-servomotor3period.bonsai) +::: + +### Adjust the Position + +:::workflow +![Adjust the Position](../workflows/apidoc-servomotor3pulse.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_StartCameras.md b/docs/apidoc/Harp_Behavior_StartCameras.md new file mode 100644 index 0000000..e4b3203 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_StartCameras.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.StartCameras +--- + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_StopCameras.md b/docs/apidoc/Harp_Behavior_StopCameras.md new file mode 100644 index 0000000..0a070bb --- /dev/null +++ b/docs/apidoc/Harp_Behavior_StopCameras.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.StopCameras +--- + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: diff --git a/docs/articles/about-these-examples.md b/docs/articles/about-these-examples.md new file mode 100644 index 0000000..a05130f --- /dev/null +++ b/docs/articles/about-these-examples.md @@ -0,0 +1,73 @@ +## About These Examples + +The following "Bonsai Workflows" section covers how to operate the device grouped into separate articles by functionality. + +Each article begins with a complete top level workflow that you can copy and paste into Bonsai to get started immediately. Every workflow is made up of these three basic building blocks: + +- A Harp device pattern that sets up the device, present in every workflow +- Branches that send commands to the device +- Branches that read events from the device + +![Workflow Basics](../images/workflowbasics-toplevel.svg) + +Subsequent sections will explain how to configure the operators in each block, with details about the specific functionality. + +> [!NOTE] +> Instead of copying the workflow, you can follow the step-by-step instructions to find and add these operators to the workflow from the Bonsai [Toolbox](https://bonsai-rx.org/docs/articles/editor.html?tabs=mouse-controls#toolbox). Make sure to use the device-specific versions, e.g. `Device (Harp.Behavior)` instead of `Device (Harp)`. If correctly selected, the names of these operators in the workflow panel will change to reflect the device name. + +### Harp Device Pattern + +![Harp Device Pattern](../images/workflowbasics-devicepattern.svg) + +The [Harp device pattern](https://harp-tech.org/articles/operators.html#device-pattern) is the first block you will need in every workflow. It will initialize the device, log data, and provide hooks to send commands as well as receive messages from a Harp device using the [Harp communication protocol](https://harp-tech.org/protocol/BinaryProtocol-8bit.html). It consists of: + +- A [`BehaviorSubject`] operator that collects all the commands in the workflow that are forwarded to the `Device Commands` subject. +- A [`Device`] operator, that establishes the serial communication link with the device. +- A [`MessageWriter`] operator that saves the messages or data from the device. The device-specific package will contain a dedicated [`DeviceDataWriter`]. +- A [`PublishSubject`] operator that broadcasts the message stream as a `Device Events` subject. + +### Send Commands to Device + +![Send Commands to Device](../images/workflowbasics-sendcommands.svg) + +To send a command to the device, the examples use: + +- A [`KeyDown`] operator that generates the command when a key is pressed. +- A [`CreateMessage`] operator that formats the command to send to the device. +- A [`MulticastSubject`] operator that sends to the command to the `Device Commands` subject. + +> [!NOTE] +> Other Bonsai operator [sources] can also be used as triggers. For instance, a [`Timer`] can be used instead of [`KeyDown`] to trigger the command at a set time after the workflow starts. + +### Read Events from Device + +![Receive Events from Device](../images/workflowbasics-receiveevents.svg) + +To receive and read events from the device, the examples use: + +- A [`SubscribeSubject`] operator that subscribes to the `Device Events` message stream. +- A [`Parse`] operator that picks out the messages corresponding to one register and decodes its values. +- A [`VisualizerWindow`] that displays the decoded values when the workflow starts. + +Each example also shows what the visualizer displays: + +```text +AnalogDataPayload { AnalogInput0 = 13, Encoder = 0, AnalogInput1 = 13 }@10.351072 +``` + +[!INCLUDE [](version-footer.md)] + + +[`BehaviorSubject`]: xref:Bonsai.Reactive.BehaviorSubject +[`CreateMessage`]: xref:Bonsai.Harp.CreateMessage +[`Device`]: xref:Bonsai.Harp.Device +[`DeviceDataWriter`]: xref:Harp.Behavior.DeviceDataWriter +[`MessageWriter`]: xref:Bonsai.Harp.MessageWriter +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`Parse`]: xref:Bonsai.Harp.Parse +[`PublishSubject`]: xref:Bonsai.Reactive.PublishSubject +[sources]: https://bonsai-rx.org/docs/articles/operators.html#source +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`Timer`]: xref:Bonsai.Reactive.Timer +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow diff --git a/docs/articles/acquire-analog-data.md b/docs/articles/acquire-analog-data.md new file mode 100644 index 0000000..6e30220 --- /dev/null +++ b/docs/articles/acquire-analog-data.md @@ -0,0 +1,61 @@ +## Acquire Analog Data + +The Behavior board has up to two analog inputs: **AD0** is located on the **ADC** connector and **AD1** is located on the **Input** connector (hardware v2.0 and later boards). The analog input can be tested with an analog output from a [photodiode](./peripherals/peripherals-photodiode.md). Refer to the [connections](./connections.md?tabs=photodiode#connections) article to set up the hardware connection on **AD0**, which we will use for the rest of these examples. + +This article covers how to visualize the timestamped analog input stream and extract a single channel with its timestamp in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Acquire Analog Data](../workflows/acquireanalogdata-toplevel.bonsai) +::: + +### Visualize Analog Data + +Both analog inputs accept voltages from 0 to 5 V, which are subsequently digitized by an onboard 12-bit analog-to-digital converter (ADC) and broadcast as an [`AnalogData`] event stream at 1 kHz. The workflow below will show you how to filter, decode and visualize the [`AnalogData`] events: + +:::workflow +![Analog Data Visualize](../workflows/acquireanalogdata-visualizedata.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`Parse`] operator and configure the `Register` property to `TimestampedAnalogData`. +- Insert a [`VisualizerWindow`] operator to automatically open a window displaying all the analog data payloads with their timestamps. + +To visualize only one of the input channels: + +- Insert a [`MemberSelector`] operator on a separate branch, this will enable you to select specific fields from the bundled analog data payload. +- Double-click the [`MemberSelector`] operator to open the editor, and add the `Value.AnalogInput0` and `Seconds` members to the selection. This will select the individual channel data as well as the timestamp. +- Insert a [`VisualizerWindow`] operator. This will open a second window displaying only the selected channel and its timestamp. + +Run the workflow, the first visualizer displays the three payload values followed by the timestamp in seconds: + +```text +AnalogDataPayload { AnalogInput0 = 13, Encoder = 0, AnalogInput1 = 13 }@10.351072 +AnalogDataPayload { AnalogInput0 = 15, Encoder = 0, AnalogInput1 = 14 }@10.352072 +``` +and the second displays the `AnalogInput0` value paired with its timestamp. + +```text +(13, 10.351072) +(15, 10.352072) +``` + +If you are using a photodiode, shine a light on the photodiode to see the analog input value change. If you are using a different signal source, vary the output voltage instead. + +> [!NOTE] +> The `Encoder` value bundled together in the payload is not an analog voltage reading but a [quadrature encoder counter](track-rotary-encoder.md) that is sampled on the same 1 kHz tick so that position and analog data share the same timestamps. + +> [!NOTE] +> The analog events are enabled by default, but if nothing appears, they may have been disabled by another [configuration](advanced-configuration.md#select-active-events) setting. Refer to the link to find out how to re-enable them. + +[!INCLUDE [](version-footer.md)] + + +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`PublishSubject`]: xref:Bonsai.Reactive.PublishSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`HarpMessages`]: xref:Bonsai.Harp.HarpMessage +[`AnalogData`]: xref:Harp.Behavior.AnalogData +[`MemberSelector`]: xref:Bonsai.Expressions.MemberSelectorBuilder diff --git a/docs/articles/advanced-configuration.md b/docs/articles/advanced-configuration.md new file mode 100644 index 0000000..cbc0b9d --- /dev/null +++ b/docs/articles/advanced-configuration.md @@ -0,0 +1,80 @@ +## Advanced Configuration + +These advanced configuration settings affect which data the Behavior board broadcasts. By default, all events are enabled, but you can selectively disable certain events. The device can also transmit serial timestamps on the peripheral port **P2** for logging and post-hoc alignment on non-Harp devices. Refer to the [connections](./connections.md?tabs=breakout#connections) article to set up the hardware connection for the serial timestamp. + +This article covers how to visualize the default event streams, select the active events, and stream serial timestamps in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Advanced Configuration](../workflows/advancedconfiguration-toplevel.bonsai) +::: + +### Visualize Analog Data + +To see one of the default streams, visualize the [`AnalogData`] event, which reports the analog inputs at 1 kHz (see [Acquire Analog Data](acquire-analog-data.md) for more details): + +:::workflow +![Visualize Analog Data](../workflows/advancedconfiguration-visualizeanalog.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`Parse`] operator and configure the `Register` property to `AnalogData`. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the parsed events when the workflow starts. + +Run the workflow. The visualizer immediately displays a rapid stream of [`AnalogData`] values, confirming that the event is enabled by default. + +### Select Active Events + +The [`EventEnable`] register selects which event streams the device broadcasts, write a new selection to select the streams you want to keep. Any event **not** selected in the payload is disabled. + +:::workflow +![Select Active Events](../workflows/advancedconfiguration-eventenable.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EventEnablePayload`. + - `EventEnable` - Enter `PortDI`, `PortDIO`, `Camera0`, `Camera1` to disable the `AnalogData` event and keep the rest. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A. The visualizer will stop showing any new [`AnalogData`](acquire-analog-data.md) events. + +### Stream Timestamps + +The [`EnableSerialTimestamp`] register enables the serial timestamp stream, an auxiliary output that can be used by non-Harp devices for logging and post-hoc alignment. + +At the start of every second, the device transmits its current time in whole seconds as a 32-bit unsigned integer in 4 bytes, least significant byte first. The transmission format is serial (UART) data at 1000 bps, with 8 data bits, no parity, and one stop bit. + +Record this signal on a digital input and decode it offline during postprocessing to align the data on the non-Harp device with other Harp data. + +To enable the stream: + +:::workflow +![Stream Timestamps](../workflows/advancedconfiguration-serialtimestamp.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EnableSerialTimestampPayload`. + - `EnableSerialTimestamp` - Select `TimestampPort2`. On older package versions, if this dropdown option is not visible, enter `4` (this value enables the [`SerialTimestampPort`]). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press S. The timestamp stream starts on the **P2** serial line at the next second boundary. Verify the signal on the digital input line on the external device, it should appear as a series of digital input transitions at one second intervals. + +> [!NOTE] +> The serial timestamp stream is not the same as the [Harp synchronization clock](https://harp-tech.org/protocol/SynchronizationClock.html), which keeps connected Harp devices synchronized. The Behavior board does not generate the Harp synchronization clock and can only receive it. For a Harp synchronization clock generator, consider the [Harp Timestamp Generator Gen3](https://github.com/harp-tech/device.timestampgeneratorgen3/). + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`AnalogData`]: xref:Harp.Behavior.AnalogData +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`EventEnable`]: xref:Harp.Behavior.EventEnable +[`EnableSerialTimestamp`]: xref:Harp.Behavior.EnableSerialTimestamp +[`SerialTimestampPort`]: xref:Harp.Behavior.SerialTimestampPorts \ No newline at end of file diff --git a/docs/articles/behavior-gui.md b/docs/articles/behavior-gui.md new file mode 100644 index 0000000..65cb17b --- /dev/null +++ b/docs/articles/behavior-gui.md @@ -0,0 +1,19 @@ +## Behavior GUI + +The Behavior GUI is a standalone visual interface for configuring and testing the device without using Bonsai. + +Before beginning, [install the GUI](installation.md#software-packages), follow the hardware setup [guide](connections.md), and connect the USB cable to the computer. Launch "Harp.Behavior.App" from the Windows Start menu. + +![Behavior GUI](../images/behavior-gui.png) + +> [!NOTE] +> This is a pre-release version of the app, there have been changes since [then](https://github.com/harp-tech/device.behavior/pull/32), but binaries have not been generated. Remember to update the screenshots and add numbered labels for the new version. + +1. Select the port for the device, and press "Connect". The device details will display on the right side if it is successfully connected. +2. Select the tab for the register group that you want to control. +3. Change the values to test outputs, LEDs, cameras, and servos, and observe the output on the connected peripherals. + +> [!WARNING] +> Only one program can access the device's COM port at a time. Close the GUI before starting a Bonsai workflow that uses the device. + +[!INCLUDE [](version-footer.md)] diff --git a/docs/articles/behavior-overview.md b/docs/articles/behavior-overview.md new file mode 100644 index 0000000..8d69487 --- /dev/null +++ b/docs/articles/behavior-overview.md @@ -0,0 +1,53 @@ +## Behavior Board + +![Harp Behavior](../images/OEPS-BehaviorBoard.jpg){width=450} + +### Key Features + +- 3 peripheral ports for plug-and-play peripherals. +- Hardware-timed pulses for all digital outputs and PWM for the four digital outputs on the **Output** connector. +- Support for camera triggering, servo motor control, and quadrature encoder counting on selected digital outputs. +- Configurable LED drive current (up to 100 mA) and RGB LED driver. + +### Specs + +- Analog inputs: 2 (0–5 V, 12-bit, sampled at 1 kHz) + - 1 on the **ADC** connector + - The second analog input on the **Input** connector is available on hardware v2.0 or later +- Digital inputs: 4 (5 V) + - 3 on the peripheral ports, accessible with the [Breakout](./peripherals/peripherals-portbreakout.md) board + - The fourth digital input on the **Input** connector is available on hardware v2.0 or later +- Digital outputs: 7 (5 V) + - 4 on the **Output** connector + - 3 on the peripheral ports, accessible with the [Breakout](./peripherals/peripherals-portbreakout.md) board +- Digital output pulse duration: 1–65535 ms (supported on all digital outputs) +- Digital output PWM: 1–10000 Hz, duty cycle 1–99% (supported on the **Output** connector only) +- Peripheral ports: 3 (RJ45) + - For the [Mice Poke](./peripherals/peripherals-micepoke.md), [Rotary Encoder](./peripherals/peripherals-rotaryencoder.md), or [Breakout](./peripherals/peripherals-portbreakout.md) board +- LED outputs: 2 (2–100 mA drive current) +- RGB LED outputs: 2 (WS2812-type addressable LEDs connector, driven as a serial chain) +- Camera triggers: 2 (**DO0**/**DO1**, 2–600 Hz) +- Servo outputs: 2 (**DO2**/**DO3**) +- Quadrature encoder inputs: 1 (**P2**, sampled at 1 kHz) +- Timestamp resolution: 32 µs +- Synchronization frequency: 1 Hz +- Synchronization accuracy: 22 ± 16 µs (between clock generator and this device) + +### Hardware + +| Version | Notes | +| ------- | ----- | +| 2.1 |
  • Changed USB connector from Mini-B to USB-C
| +| 2.0 |
  • Added an input connector with an extra analog input and digital input.
| +| 1.1 |
  • Initial version
| + +### Firmware + +| Version | Notes | +| ------- | ----- | +| 3.3 |
  • Fixed the read function of the digital inputs register
| +| 3.2 |
  • Add limits to ServoMotor registers
  • Create displacement reading option for quadrature encoder.
| +| 3.1 |
  • Support for hardware 2.0
  • Added serial timestamp registers
| +| 3.0 |
  • Initial version
| + +[!INCLUDE [](version-footer.md)] diff --git a/docs/articles/breakout-note.md b/docs/articles/breakout-note.md new file mode 100644 index 0000000..dc8cf9b --- /dev/null +++ b/docs/articles/breakout-note.md @@ -0,0 +1,2 @@ +> [!NOTE] +> If you need more digital inputs or outputs, the [Breakout](./peripherals/peripherals-portbreakout.md) extension board makes the peripheral ports' pins available as regular screw-terminal inputs and outputs. diff --git a/docs/articles/connections.md b/docs/articles/connections.md new file mode 100644 index 0000000..4cc1729 --- /dev/null +++ b/docs/articles/connections.md @@ -0,0 +1,199 @@ +## Ports and Connections + +This article covers the ports on the Behavior board, as well as how to connect the device to peripherals and external devices. + +### Ports + +![Harp Behavior Device Pinout](../images/behavior-devicepinout.svg){width=600} + +**12V PWR (Barrel Jack)** - This port powers the Behavior board and requires a 12 V power supply. + +**USB (Mini-B/USB-C)** - This port connects the device to the control computer running [Bonsai](harp-bonsai.md) or the [GUI](./behavior-gui.md). The connector type depends on the [hardware version](./behavior-overview.md) of the board. + +**CLKIN (Stereo Jack)** - This [Harp](https://harp-tech.org/articles/about.html) clock input accepts a clock output from any compatible Harp clock generator or synchronizer (e.g. [Harp Timestamp Generator](https://github.com/harp-tech/device.timestampgeneratorgen3)) for synchronization with other connected devices. + +**State** - This status LED cycles on and off with a period of: +- 2 seconds when it's communicating with Bonsai +- 4 seconds when in standby +- 100 milliseconds when a catastrophic error occurs + +**P0, P1, P2 (RJ45)** - These specialized peripheral ports interface directly with the [Mice Poke](./peripherals/peripherals-micepoke.md) peripheral for poke detection and reward delivery. Alternatively, use the [Breakout](./peripherals/peripherals-portbreakout.md) extension board to interface with other peripherals and accessories. Port **P2** additionally accepts the [Rotary Encoder](./peripherals/peripherals-rotaryencoder.md) peripheral for [rotation tracking](track-rotary-encoder.md). + +**ADC (Screw Terminal)** - This connector carries the first analog input (**AD0**), a 5 V supply pin and two ground connections. + +**Output (Screw Terminal)** - These general-purpose 5 V digital outputs can be used to communicate with external devices. **DO0**/**DO1** can generate [camera triggers](trigger-cameras.md) and **DO2**/**DO3** can drive [servo motors](drive-servos.md); all four support [PWM](generate-pwm.md). + +**Input (Screw Terminal)** - This connector carries the second analog input (**AD1**), the digital input **DI3** and one ground connection. This connector is only available on hardware v2.0 or later boards. + +**RGB (3-pin Flick Lock)** - Connector for up to two WS2812-type individually addressable RGB LEDs, driven as a serial chain on a single data line. Colors are set with the [RGB registers](control-leds.md#set-rgb-colors). + +**L0, L1 (Screw Terminal)** - These connectors control two regular current-controlled LED outputs. Each terminal pair is marked **A** (anode, the LED's long leg) and **K** (cathode, the short leg). The drive current is [configurable](control-leds.md) from 2 to 100 mA. + +### Connections + +# [Analog Input](#tab/analoginput) + +![Analog Input](../images/connection-analoginput.svg){width=600} + +1. Wire the analog signal (0–5 V) to either **AD0** on the **ADC** connector (shown above) or **AD1** (hardware v2.0 or later) on the **Input** connector. +2. Connect the ground wire to any **GND** pin. +3. Refer to the [Acquire Analog Data](acquire-analog-data.md) article to read the signal in Bonsai. + +# [Digital Input](#tab/digitalinput) + +![Digital Input](../images/connection-digitalinput.svg){width=600} + +1. Wire the 5 V digital signal to **DI3** on the **Input** connector (hardware v2.0 or later) and its ground to any **GND** pin. +2. Alternatively, use the [Breakout](./peripherals/peripherals-portbreakout.md) board to unlock more digital inputs on the peripheral ports. +3. Refer to the [Read Digital Inputs](read-digital-inputs.md) article to visualize the input events in Bonsai. + +# [Digital Output](#tab/digitaloutput) + +![Digital Output](../images/connection-digitaloutput.svg){width=600} + +1. Wire the external device's digital input to one of **DO0**–**DO3** on the **Output** connector, and connect the external device's ground to any **GND** pin. +2. Alternatively, use the [Breakout](./peripherals/peripherals-portbreakout.md) board to unlock more digital outputs on the peripheral ports. +3. Refer to the [Control Digital Outputs](control-digital-outputs.md) article to switch the output in Bonsai. + +# [Photodiode](#tab/photodiode) + +![Photodiode](../images/connection-photodiode.svg){width=600} + +Before connecting the [Photodiode](./peripherals/peripherals-photodiode.md) peripheral, switch the jumper setting on the casing to either **ANA** for an analog reading or **DIG** for a digital output. Plug the stereo adapter cable into the stereo jack on the peripheral. The other end of the cable has three colored wires for the signal, 5 V supply and ground, as shown above. + +For an analog reading: + +1. Wire the signal wire to either **AD0** on the **ADC** connector (shown above) or **AD1** on the **Input** connector (hardware v2.0 or later). +2. Wire the supply wire to any **+5 V** pin and the ground wire to any **GND** pin. +3. Refer to the [Acquire Analog Data](acquire-analog-data.md) article to read the light intensity as an analog reading in Bonsai. + +Alternatively, for a digital output: +1. Wire the signal wire to **DI3** on the **Input** connector (hardware v2.0 or later) if you have access to it. +2. Otherwise, use the [Breakout](./peripherals/peripherals-portbreakout.md) board to unlock more digital inputs on the peripheral ports. +3. Refer to the [Read Digital Inputs](./read-digital-inputs.md) article to read the light intensity as a digital input reading in Bonsai. +4. Turn the adjustment screw to tune the light threshold for the low and high state of the digital output and monitor the response in Bonsai. + +>[!NOTE] +> Third-party photodiode modules that are powered with 5 V and output a 0 to 5 V signal can be wired the same way. + +# [Speaker](#tab/speaker) + +![Speaker](../images/connection-speaker.svg){width=600} + +1. Wire the [Speaker](./peripherals/peripherals-speaker.md) peripheral to the **Output** connector: the **+** terminal to one of **DO0**–**DO3** and the **-** terminal to any **GND** pin. +2. Refer to the [Generate PWM](generate-pwm.md) article to play tones in Bonsai. + +>[!NOTE] +> Third-party passive buzzers or speakers can be driven with PWM in the same way. Active buzzers generate a fixed tone, so switch them on and off like any other digital output (see [Control Digital Outputs](control-digital-outputs.md)). Add a current-limiting series resistor (100 to 330 Ω) to avoid overloading the 5 V supply. + +# [LED](#tab/led) + +![LED](../images/connection-led.svg){width=600} + +1. Wire a standard LED to either the **L0** or **L1** terminal pair with the long leg (anode) to the **A** pin and the short leg (cathode) to **K**. No series resistor is needed as the drive current can be set in Bonsai. +2. Connect a WS2812-type addressable RGB LED to the **RGB** connector with the signal wire going to **S** and the power and ground going to **5V** and **G**. +3. Up to two RGB LEDs can be driven. Connect the second one as a serial chain with the same wiring configuration. +4. Refer to the [Control LEDs](control-leds.md) article to configure and switch the LEDs in Bonsai. + +# [Mice Poke](#tab/poke) + +![Mice Poke](../images/connection-poke.svg){width=600} + +1. Connect the [Mice Poke](./peripherals/peripherals-micepoke.md) peripheral to port **P0**, **P1**, or **P2** with an RJ45 cable. +2. If the peripheral comes with an integrated water valve, connect the valve's inlet to the liquid container with tubing (2.0 mm inner diameter FEP, or 2.1 mm PTFE). +3. Refer to the [Control Poke Peripheral](control-poke.md) article to configure and use the Mice Poke peripheral in Bonsai. + +No further wiring is necessary. The screw terminal blocks are only needed for external use; they tap the same connections that are carried by the RJ45 connector. +Use them to control the peripheral from another device, log its signals, wire a different solenoid valve, or connect an extra sensor. + +For wiring to the screw terminals: + +1. Share ground between the external device and any **GND** terminal. +2. Use the **+5V** terminal to power the peripheral when it is not connected to the Behavior board, or to power external devices when it is. Never connect an external supply to **+5V** while the Behavior board is also connected. +3. Wire external signals (5 V logic) to the labeled terminals: + - **DIO1** - This line is not connected to any of the peripheral sensors and acts as an extra digital input (the functionality to toggle it to digital output has not been added yet). Use it to add an external sensor like a lever. The Behavior board reports the changes as [port DIO events](read-digital-inputs.md#visualize-port-dio-events). + - **IR LED**, **IR PHT** - Connects to the infrared beam LED emitter, as well as the infrared photodetector. Use it to either control or mirror those signals. + - **LED** - Connected to the [onboard cue LEDs](control-poke.md#drive-the-poke-led). Use it to control the LED, mirror the signal, or add an extra LED (no series resistor is needed). +4. To use your own solenoid valve for reward delivery, disconnect the integrated valve's leads from the **VALVE** terminal (if fitted) and wire a 12 V solenoid valve across the terminal pair. For standard coil-only solenoid valves, polarity does not matter. + +# [Rotary Encoder](#tab/encoder) + +![Encoder](../images/connection-encoder.svg){width=600} + +1. Connect the [Rotary Encoder](./peripherals/peripherals-rotaryencoder.md) peripheral to port **P2** with an RJ45 cable. This is the only port with the quadrature counter functionality. +2. Refer to the [Track Rotary Encoder](track-rotary-encoder.md) article to read the encoder in Bonsai. + +No further wiring is necessary. The solder pads are only needed for external use; they share the same lines as the onboard rotary encoder. Use the solder pads to wire an external rotary encoder in place of the onboard one, tap the raw quadrature signals for logging, or to operate the peripheral from another device entirely. + +For wiring to the solder pads: + +1. Share ground between the external device and the **-** pad. +2. Use the **+** pad to power the external encoder when the Behavior board is connected, or to power the peripheral when it is not. Never connect an external supply to **+** while the Behavior board is also connected. +3. Wire an external encoder's quadrature signals (5 V logic) to the **A** and **B** pads: + - Do not turn the onboard encoder while an external one is wired, as both share the same lines. Alternatively, disconnect the onboard rotary encoder. +4. To log the raw quadrature signals from the onboard encoder instead, connect **A** and **B** to digital inputs. + +An external rotary encoder can also be connected using the [Breakout](./peripherals/peripherals-portbreakout.md) board, refer to the Breakout tab for more information. + +# [Camera](#tab/camera) + +![Camera](../images/connection-camera.svg){width=600} + +1. Locate the GPIO (general purpose input/output) connector on your camera. Refer to the camera manual for the connector pinout as it varies widely between camera models and manufacturers. +2. Check that the camera is compatible with the 5 V trigger signal from the Behavior board. For cameras with lower-voltage trigger inputs (e.g. 1.8 V or 3.3 V logic), add a level shifter between the output and the camera. +3. Configure the external trigger in the camera vendor's software to use the rising edge of the trigger. Avoid modes that use the trigger pulse width to control exposure as the pulse width is fixed at half the trigger period. +4. Wire the camera's external trigger input to **DO0** or **DO1** on the **Output** connector. These are the only ports that support the camera trigger functionality. +5. Connect the camera's trigger ground to any **GND** pin. +6. Refer to the [Trigger Cameras](trigger-cameras.md) article to configure and start the trigger in Bonsai. + +# [Servo](#tab/servo) + +![Servo](../images/connection-servo.svg){width=600} + +1. Connect the servo signal wire to **DO2** or **DO3** on the **Output** connector. These are the only ports that support the servo functionality. +2. Connect the servo power wire to the **+5V** pin on the **ADC** connector. For servos that draw more than 200 mA, or that require a supply voltage other than 5 V, power the servo from an external supply matching its rating instead. Never connect the external supply to the board's 5 V pin; it must power the servo only. +3. Alternatively, use the [Breakout](./peripherals/peripherals-portbreakout.md) board to unlock more power pins on the peripheral ports. +4. Connect the servo ground wire to a **GND** pin. For servos requiring an external power supply, connect the external supply's ground to a **GND** pin. +5. Refer to the [Drive Servos](drive-servos.md) article to move the servo in Bonsai. + +# [Breakout](#tab/breakout) + +![Breakout](../images/connection-breakout.svg){width=600} + +Both versions of the [Breakout](./peripherals/peripherals-portbreakout.md) board are shown above. Follow the instructions for the version you have, some of the functionality is only available for a specific version. + +For digital input and output connections (both): +1. Connect the Breakout board to port **P0**, **P1**, or **P2** with an RJ45 cable. +2. Wire the signal wire from external devices to the **DI**, **DIO**, and **DO** screw terminals. +3. Wire the **+5V** pin and **GND** pins to provide power and ground. +4. Refer to the [Read Digital Inputs](read-digital-inputs.md) and [Control Digital Outputs](control-digital-outputs.md) articles to use these lines in Bonsai. + +For connecting an external rotary encoder (both): +1. Connect the Breakout board to port **P2** with an RJ45 cable. The quadrature counter is only available on this port. +2. Wire the encoder's **A** channel to the **DI** terminal and its **B** channel to the **DIO** terminal. Both channels must be 5 V logic. +3. Wire the encoder's supply to the **+5V** terminal and its ground to a **GND** terminal. For encoders that require a different supply voltage, power the encoder from an external supply instead and share only its ground with a **GND** terminal. +4. Leave any index (**Z**) output of the encoder unconnected as the Behavior board does not support it. +5. Refer to the [Track Rotary Encoder](track-rotary-encoder.md) article to read the encoder in Bonsai. If the count runs in the opposite direction to the rotation, swap the **A** and **B** wires. + +For valve control (v1.1 only): +1. Connect the [Breakout](./peripherals/peripherals-portbreakout.md) board to port **P0**, **P1**, or **P2** with an RJ45 cable. +2. Wire a 12 V solenoid valve between the **+12V** and **SUP_RTN** terminals. +3. Refer to [Deliver Rewards on Poke](control-poke.md#deliver-rewards-on-poke) to pulse the valve line in Bonsai. + +For streaming the serial timestamp (v2.x only): +1. Connect the board to **P2**, the timestamp stream can only be transmitted on this port. +2. Wire the **TX** terminal to the receiving device's **RX** input or to a logged digital input and a **GND** terminal to its ground. +3. Set the board's logic-level jumper to match the receiver's operating voltage level (3.3 V or 5 V). +4. Refer to the [Stream Timestamps](advanced-configuration.md#stream-timestamps) section to enable the stream in Bonsai. + +# [Harp Synchronization](#tab/harpsynchronization) + +![Harp Synchronization](../images/connection-harpsynchronization.svg){width=600} + +1. Connect a clock output of a Harp clock generator (e.g. the [Harp Timestamp Generator](https://github.com/harp-tech/device.timestampgeneratorgen3)) to the **CLKIN** jack with a stereo plug cable. +2. The Behavior board adopts the generator's clock automatically. To verify the connection, check that the **STATE** LEDs of the connected boards blink simultaneously. +3. Refer to the [Harp synchronization clock](https://harp-tech.org/protocol/SynchronizationClock.html) documentation for how devices synchronize. + +--- + +[!INCLUDE [](version-footer.md)] diff --git a/docs/articles/control-digital-outputs.md b/docs/articles/control-digital-outputs.md new file mode 100644 index 0000000..608556e --- /dev/null +++ b/docs/articles/control-digital-outputs.md @@ -0,0 +1,139 @@ +## Control Digital Outputs + +The Behavior board has four general-purpose digital outputs **DO0**–**DO3** on the **Output** connector. Refer to the [connections](./connections.md?tabs=digitaloutput#connections) article to set up a digital output on **DO0**, which we will use for the rest of these examples. + +This article covers how to set, clear, toggle, and pulse any of these outputs in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Control Digital Outputs](../workflows/controldigitaloutputs-toplevel.bonsai) +::: + +> [!NOTE] +> The commands in the examples below can be used to control every output line of the Behavior board. Their location and values in Bonsai are: +> - General purpose digital outputs **DO0**–**DO3**: `DO0` - `DO3`. +> - Peripheral ports **P0**–**P2**: the 5 V output lines are represented as `DOPort0`–`DOPort2` and 12 V valve lines as `SupplyPort0`–`SupplyPort2`. See [Control Poke Peripheral](control-poke.md). +> - LED connectors **L0**, **L1** and **RGB**: represented as `Led0`, `Led1`, `Rgb0` and `Rgb1` in Bonsai. See [Control LEDs](control-leds.md). + +[!INCLUDE [](breakout-note.md)] + +### Set and Clear Outputs + +Use the [`OutputSet`] and [`OutputClear`] registers to turn output lines on and off. + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputClearPayload`. + - `OutputClear` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press A to set the **DO0** line high and S to set it low. + +> [!NOTE] +> A single command can drive several outputs at once. To select multiple lines, type the names separated by a comma (e.g. `DO0`, `DO1`) in the payload field. Any lines not selected are left untouched. + +### Toggle Outputs + +The [`OutputToggle`] register inverts the current state of the selected output lines. + +:::workflow +![Toggle Outputs](../workflows/controldigitaloutputs-toggle.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputTogglePayload`. + - `OutputToggle` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press D repeatedly. The **DO0** line inverts its state on every press. + +### Write All Outputs + +The [`OutputState`] register writes every output line in a single command: selected lines are set and all other lines are cleared. Use it to drive the whole output bank to a known state, for example when initializing an experiment. + +:::workflow +![Write All Outputs](../workflows/controldigitaloutputs-state.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `G`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputStatePayload`. + - `OutputState` - Select `DO0` and `DO1`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press G. The **DO0** and **DO1** lines go high and every other output goes low. Try setting other outputs first with the commands from the previous sections; the [`OutputState`] write overrides them all. + +> [!WARNING] +> [`OutputState`] acts on every output of the Behavior board, including the peripheral port and LED lines. To change a few lines while leaving the rest untouched, use [`OutputSet`], [`OutputClear`] or [`OutputToggle`] instead. + +### Pulse Outputs + +The device can generate hardware-timed pulses with a defined duration. Enable pulse mode by selecting output lines in the [`OutputPulseEnable`] register, and set the duration in the output line's pulse-duration register (e.g. [`PulseDO0`] for **DO0**, in milliseconds). Sending an [`OutputSet`] command then starts a pulse that turns off after the elapsed time instead of remaining on. + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputPulseEnablePayload`. + - `OutputPulseEnable` - Select `DO0` to enable pulse mode on **DO0**. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PulseDO0Payload`. + - `PulseDO0` - Set the pulse duration to 500 ms. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press F once to configure the pulse, then send a set command with A from [Set and Clear Outputs](#set-and-clear-outputs). The **DO0** line goes high for 500 ms and returns low on its own. + +[!INCLUDE [](outputpulseenable-warning.md)] + +> [!TIP] +> The poke valve outputs (`SupplyPort0`–`SupplyPort2`) boot with pulse mode already enabled and a default duration of 15 ms; see [Deliver Rewards on Poke](control-poke.md#deliver-rewards-on-poke). All other outputs boot with pulse mode disabled and stay on until cleared. + +> [!TIP] +> This method is preferred to timing pulses in software (e.g. pairing a set command with a delay and a clear command). Software timing is subject to non-real-time OS latency and jitter, which are most noticeable on short pulses. + +### Alternative: Set Outputs with Timer + +You can replace [`KeyDown`] with other operators to set outputs with other triggers in Bonsai, for instance a [`Timer`] to send triggers at a set time. + +:::workflow +![Set Outputs Timer](../workflows/controldigitaloutputs-timer.bonsai) +::: + +- Insert a [`Timer`] operator and set the `DueTime` property to the number of seconds to wait before setting the output (e.g. `00:00:02` for two seconds). +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and the **DO0** line goes high after 2 seconds and turns off automatically if pulse mode is enabled. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`Timer`]: xref:Bonsai.Reactive.Timer +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`OutputSet`]: xref:Harp.Behavior.OutputSet +[`OutputClear`]: xref:Harp.Behavior.OutputClear +[`OutputToggle`]: xref:Harp.Behavior.OutputToggle +[`OutputState`]: xref:Harp.Behavior.OutputState +[`OutputPulseEnable`]: xref:Harp.Behavior.OutputPulseEnable +[`PulseDO0`]: xref:Harp.Behavior.PulseDO0 diff --git a/docs/articles/control-leds.md b/docs/articles/control-leds.md new file mode 100644 index 0000000..a83232f --- /dev/null +++ b/docs/articles/control-leds.md @@ -0,0 +1,117 @@ +## Control LEDs + +The Behavior board drives two kinds of light output: two standard current-controlled LEDs on the **L0** and **L1** connectors and up to two WS2812-type addressable RGB LEDs on the **RGB** connector. Refer to the [connections](./connections.md?tabs=led#connections) article to set up the LED on **L0** or the **RGB** connector, which we will use for the rest of these examples. + +This article covers configuring LED drive current, setting RGB colors, and turning on both kinds of LED output in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Control LEDs](../workflows/controlleds-toplevel.bonsai) +::: + +### Configure LED Current + +The **L0** and **L1** outputs drive standard single-color LEDs with a configurable constant current, so no series resistor is needed. Each output has a working current register ([`Led0Current`], 2–100 mA) and a protection limit ([`Led0MaxCurrent`], 5–100 mA); writes above the limit are rejected by the device. + +:::workflow +![Configure LED Current](../workflows/controlleds-current.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `Led0MaxCurrentPayload`. + - `Led0MaxCurrent` - Set the maximum allowed current according to the rating of the LED in mA (e.g. 20). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `Led0CurrentPayload`. + - `Led0Current` - Set the working current in mA (e.g. 10). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A to configure the **L0** drive current, then switch the output on as shown in the next section. + +### Turn LEDs On and Off + +Once the drive current is configured, the **L0** and **L1** outputs are switched like any other digital output, for instance through the [`OutputSet`](control-digital-outputs.md) and [`OutputClear`](control-digital-outputs.md) registers: + +:::workflow +![Turn LEDs On and Off](../workflows/controlleds-ledonoff.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `Led0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputClearPayload`. + - `OutputClear` - Select `Led0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press S to turn on the LED and D to turn it off. See [Control Digital Outputs](control-digital-outputs.md) for other methods to control the LED. + +### Set RGB Colors + +The **RGB** connector drives WS2812-type individually addressable LEDs. The two LEDs form a serial chain on a single data line: **Rgb0** is the first LED in the chain and **Rgb1** the second when configuring and controlling these LEDs. Single color LEDs have no data input and do not work on this connector; drive those from the [L0/L1 outputs](#configure-led-current) instead. Analog RGB LEDs are not supported on either. + +The [`RgbAll`] register writes the color of both RGB LEDs in one command. Each channel takes an intensity from 0 to 255. + +:::workflow +![Set RGB Colors](../workflows/controlleds-rgbcolors.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `RgbAllPayload`. + - `Red0` - Set to 255 to make **Rgb0** red. + - `Blue1` - Set to 255 to make **Rgb1** blue. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press F to load the colors. If the LEDs are currently on, the new colors take effect immediately. + +> [!NOTE] +> To configure one LED at a time, use the [`Rgb0`] or [`Rgb1`] registers instead. + +> [!NOTE] +> There is a bug in the current firmware (v3.3) where the red and green channels are switched. + +### Turn RGB LEDs On and Off + +The RGB LEDs are switched like any other digital output, for instance through the [`OutputSet`](control-digital-outputs.md) and [`OutputClear`](control-digital-outputs.md) registers: + +:::workflow +![Turn RGB LEDs On and Off](../workflows/controlleds-rgbonoff.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `G`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `Rgb0` and `Rgb1`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `H`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputClearPayload`. + - `OutputClear` - Select `Rgb0` and `Rgb1`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press G to turn on both RGB LEDs and H to turn them off. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`RgbAll`]: xref:Harp.Behavior.RgbAll +[`Rgb0`]: xref:Harp.Behavior.Rgb0 +[`Rgb1`]: xref:Harp.Behavior.Rgb1 +[`Led0Current`]: xref:Harp.Behavior.Led0Current +[`Led1Current`]: xref:Harp.Behavior.Led1Current +[`Led0MaxCurrent`]: xref:Harp.Behavior.Led0MaxCurrent diff --git a/docs/articles/control-poke.md b/docs/articles/control-poke.md new file mode 100644 index 0000000..06a07bf --- /dev/null +++ b/docs/articles/control-poke.md @@ -0,0 +1,129 @@ +## Control Poke Peripheral + +The [Mice Poke](./peripherals/peripherals-micepoke.md) is a specialized nose poke peripheral for the Behavior board which combines an infrared beam sensor for poke detection, cue LEDs, and a solenoid valve for reward delivery. Refer to the [connections](./connections.md?tabs=poke#connections) article to set up the hardware connection on peripheral port **P0**, which we will use for the rest of these examples. + +This article covers how to visualize poke events, debounce noisy inputs, drive the cue LED, and deliver rewards with the Mice Poke peripheral in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Detect Pokes](../workflows/controlpoke-toplevel.bonsai) +::: + +[!INCLUDE [](breakout-note.md)] + +### Visualize Poke Events + +Beam breaks in the Mice Poke peripheral are reported as digital input events. The three peripheral ports **P0**–**P2** are represented as `DIPort0` - `DIPort2` in the [`DigitalInputState`] event register. + +:::workflow +![Detect Pokes Visualize Events](../workflows/controlpoke-visualizeevents.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. This will listen to [`HarpMessages`] broadcast from the [`PublishSubject`] named `Behavior Events` in the Harp device pattern. +- Insert a [`Parse`] operator and configure the `Register` property to `TimestampedDigitalInputState`. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the parsed events when the workflow starts. + +Run the workflow and block the infrared beam on the Mice Poke peripheral. The visualizer will display: + +```text +DIPort0@3.213504 +None@3.513823 +``` + +The first value is the payload, listing the digital inputs that are currently active, and the second value is the timestamp on the device clock. Both beam breaks and beam restores generate an event, so `None` marks a poke exit. + +### Configure Input Filter + +A single poke can generate a burst of rapid transitions, for example, when the snout hovers at the edge of the infrared beam. Use the [`PokeInputFilter`] register to set a refractory period in milliseconds. After each reported transition, further transitions on that port are ignored for the set time. + +:::workflow +![Detect Pokes Input Filter](../workflows/controlpoke-inputfilter.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PokeInputFilterPayload`. + - `PokeInputFilter` - Set the filter time to 5 ms. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A. Rapid repeated transitions within 5 ms of a poke event no longer generate events. Set the value to 0 to disable the filter. The default filter time is 1 ms. + +> [!TIP] +> The filter is blind to the cause of a transition, so values much longer than the animal's fastest re-entry will also ignore genuine consecutive pokes. + +### Drive the Poke LED + +Each peripheral port carries an LED drive line (`DOPort0` - `DOPort2`). The LED is controlled like any other digital output. For instance, you can turn it on and off with the [`OutputSet`] and [`OutputClear`] registers: + +:::workflow +![Detect Pokes Drive LED](../workflows/controlpoke-driveled.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `DOPort0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputClearPayload`. + - `OutputClear` - Select `DOPort0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press S to turn the **P0** poke LED on and D to turn it off. See [Control Digital Outputs](control-digital-outputs.md) for other methods to control the LED. + +### Deliver Rewards on Poke + +Each peripheral port carries a 12 V valve drive line for a solenoid valve that gates liquid reward delivery. The workflow below enables [pulse mode](control-digital-outputs.md#pulse-outputs) on the valve output and configures the pulse duration, which can be calibrated to adjust the reward volume. It then closes the loop in Bonsai where every poke at **P0** immediately triggers a reward at the same port. + +:::workflow +![Detect Pokes Deliver Rewards](../workflows/controlpoke-valve.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputPulseEnablePayload`. + - `OutputPulseEnable` - Select `SupplyPort0` to enable pulse mode on the **P0** valve output. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PulseSupplyPort0Payload`. + - `PulseSupplyPort0` - Set the valve opening duration in ms (e.g. 15). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`Parse`] operator and configure the `Register` property to `DigitalInputState`. +- Insert a [`HasFlag`] operator and set the `Value` property to `DIPort0`. This operator will generate a boolean value (e.g. `True`) if it detects a beam break that matches that pin. +- Insert a [`Condition`] operator, leaving its inner workflow at the default. This operator lets through only `True` elements corresponding to beam breaks at **P0**, which are used to trigger the next command. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload` to select the register that turns on digital output lines. + - `OutputSet` - Select `SupplyPort0` to select the valve delivery line for **P0**. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press F once to configure the valve pulse, then block the infrared beam on the **P0** poke. The valve will open for 15 ms and close on its own, delivering one reward per poke. + +[!INCLUDE [](outputpulseenable-warning.md)] + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`PublishSubject`]: xref:Bonsai.Reactive.PublishSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`HarpMessages`]: xref:Bonsai.Harp.HarpMessage +[`DigitalInputState`]: xref:Harp.Behavior.DigitalInputState +[`PokeInputFilter`]: xref:Harp.Behavior.PokeInputFilter +[`OutputSet`]: xref:Harp.Behavior.OutputSet +[`OutputClear`]: xref:Harp.Behavior.OutputClear +[`PulseSupplyPort0`]: xref:Harp.Behavior.PulseSupplyPort0 +[`HasFlag`]: xref:Bonsai.Expressions.HasFlagBuilder +[`Condition`]: xref:Bonsai.Reactive.Condition diff --git a/docs/articles/drive-servos.md b/docs/articles/drive-servos.md new file mode 100644 index 0000000..535c418 --- /dev/null +++ b/docs/articles/drive-servos.md @@ -0,0 +1,86 @@ +## Drive Servos + +The digital outputs **DO2** and **DO3** can drive standard servo motors, which can be used, for instance, to move a lick spout or a door in and out of reach. Refer to the [connections](./connections.md?tabs=servo#connections) article to set up the servo motor on **DO2**, which we will use for the rest of these examples. + +This article covers how to configure the servo, enable and disable the pulse train, and adjust the position in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Drive Servos](../workflows/driveservos-toplevel.bonsai) +::: + +### Configure the Servo + +To configure the servo, set the period and pulse-width registers for the digital output ([`ServoMotor2Period`] and [`ServoMotor2Pulse`] for **DO2**) in microseconds. The period sets the refresh rate for the servo update and the pulse width sets the servo angle. + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `ServoMotor2PeriodPayload`. + - `ServoMotor2Period` - Set the period of the servo pulse train in µs (e.g. 20000 for a 50 Hz servo update). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `ServoMotor2PulsePayload`. + - `ServoMotor2Pulse` - Set the pulse width in µs (e.g. 1500 for the center position of a standard servo, the range is typically 1000–2000 µs). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press A to set the servo period and S to set the servo starting angle. The two commands are bound to separate keys, so you can reset the angle later without reconfiguring the period. Check your servo's datasheet for its period and pulse-width range if you are unsure about which values to use. + +### Enable and Disable Servos + +Use the [`EnableServos`] and [`DisableServos`] registers to turn on and off the servo: + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EnableServosPayload`. + - `EnableServos` - Select `ServoOutput2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `DisableServosPayload`. + - `DisableServos` - Select `ServoOutput2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press D to enable the servo and F to stop. The servo moves to the starting position set in the previous exercise. + +### Adjust the Position + +While the servo is enabled, writing a new pulse width moves it immediately: + +:::workflow +![Adjust the Position](../workflows/driveservos-position.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `G`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `ServoMotor2PulsePayload`. + - `ServoMotor2Pulse` - Set a new pulse width in µs (e.g. 2000). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press G to move the servo to a new position. Press S to move it back to the starting angle. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`ServoMotor2Period`]: xref:Harp.Behavior.ServoMotor2Period +[`ServoMotor2Pulse`]: xref:Harp.Behavior.ServoMotor2Pulse +[`EnableServos`]: xref:Harp.Behavior.EnableServos +[`DisableServos`]: xref:Harp.Behavior.DisableServos diff --git a/docs/articles/generate-pwm.md b/docs/articles/generate-pwm.md new file mode 100644 index 0000000..d1385c0 --- /dev/null +++ b/docs/articles/generate-pwm.md @@ -0,0 +1,90 @@ +## Generate PWM + +The four general-purpose outputs **DO0**–**DO3** can generate hardware-timed pulse-width modulation (PWM) signals. The PWM signal can be tested with either a [speaker](./peripherals/peripherals-speaker.md) (where the frequency controls the pitch) or an LED (where the duty cycle controls the brightness). Refer to the [connections](./connections.md?tabs=speaker#connections) article to set up either accessory on **DO0**, which we will use for the rest of these examples. + +This article covers how to configure the frequency and duty cycle, as well as how to generate and stop the PWM in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Generate PWM](../workflows/generatepwm-toplevel.bonsai) +::: + +### Configure PWM + +Each output has its own frequency and duty cycle registers, for instance [`PwmFrequencyDO0`] and [`PwmDutyCycleDO0`] for **DO0**. Configure these registers before starting the PWM signal. + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PwmFrequencyDO0Payload`. + - `PwmFrequencyDO0` - Set the PWM frequency in Hz (e.g. 1000). Valid values are 1 to 10000. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PwmDutyCycleDO0Payload`. + - `PwmDutyCycleDO0` - Set the duty cycle in percent (e.g. 50). Valid values are 1 to 99. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A to configure a 1 kHz, 50% duty cycle waveform on **DO0**. Frequency and duty cycle can also be modified while the PWM signal is running. + +### Start and Stop PWM + +The [`PwmStart`] and [`PwmStop`] registers start and stop the waveform on any combination of outputs. + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PwmStartPayload`. + - `PwmStart` - Select `PwmDO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PwmStopPayload`. + - `PwmStop` - Select `PwmDO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press S to start and D to stop the waveform on **DO0**. + +### Generate PWM Bursts + +To generate a PWM train of fixed duration, enable the [pulse mode](control-digital-outputs.md#pulse-outputs) on the output with the [`OutputPulseEnable`] register and configure the duration in the [`PulseDO0`] register. + +:::workflow +![Generate PWM Bursts](../workflows/generatepwm-pulseenable.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputPulseEnablePayload`. + - `OutputPulseEnable` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PulseDO0Payload`. + - `PulseDO0` - Set the burst duration to 100 ms. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press F once to configure the pulse, then press S. The PWM runs for 100 ms and stops on its own, which translates to either a short beep with a speaker or a brief flash with an LED. + +[!INCLUDE [](outputpulseenable-warning.md)] + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`PwmFrequencyDO0`]: xref:Harp.Behavior.PwmFrequencyDO0 +[`PwmDutyCycleDO0`]: xref:Harp.Behavior.PwmDutyCycleDO0 +[`PwmStart`]: xref:Harp.Behavior.PwmStart +[`PwmStop`]: xref:Harp.Behavior.PwmStop +[`OutputPulseEnable`]: xref:Harp.Behavior.OutputPulseEnable +[`PulseDO0`]: xref:Harp.Behavior.PulseDO0 diff --git a/docs/articles/harp-bonsai.md b/docs/articles/harp-bonsai.md new file mode 100644 index 0000000..e05f3ce --- /dev/null +++ b/docs/articles/harp-bonsai.md @@ -0,0 +1,47 @@ +## Bonsai + +Bonsai is a visual reactive programming language for building interactive experiments and processing data streams in real time. It supports a growing ecosystem of hardware and software packages that are commonly used in neuroscience. This article covers how to set up the Behavior board in Bonsai. + +>[!TIP] +> More information on Bonsai can be found in the official [documentation](https://bonsai-rx.org/docs/). + +### First Steps + +We will use a simple example to connect and test the device in Bonsai. This example visualizes the analog input stream that the Behavior board broadcasts at 1 kHz. You do not need to connect an analog input device, we will revisit this example later in more detail in the "Bonsai Workflows" section. + +Before beginning: +- Connect the [USB](connections.md) cable to the computer. +- Launch "Bonsai" from the Windows Start menu. +- Hover over the workflow cell below, and click on the "Copy" icon on the top right. +- Paste the workflow into Bonsai. + +:::workflow +![Behavior First Steps](../workflows/behavior-firststeps.bonsai) +::: + +> [!TIP] +> If your workflow does not look like the one above, make sure that the [Harp.Behavior](./installation.md#software-packages) package is installed. + +- Click on the [`Behavior (Device)`] operator and set the `PortName` property to the communications port for the device (e.g. COM8). +- Click on the [`BehaviorDataWriter (DeviceDataWriter)`] operator and set the `Path` property for the name and location of the save folder (e.g. `Behavior.harp`). +- Press the "Start" button in Bonsai to run the workflow. + +A [visualizer](xref:Bonsai.Design.VisualizerWindow) will automatically open when the workflow starts, displaying the parsed [`AnalogData`] events streaming from the device: + +```text +AnalogDataPayload { AnalogInput0 = 13, Encoder = 0, AnalogInput1 = 13 } +AnalogDataPayload { AnalogInput0 = 15, Encoder = 0, AnalogInput1 = 14 } +``` + +The device is ready to use! If, instead, an error appears in Bonsai, check out the [troubleshooting](troubleshooting.md) section. + +Next, we suggest going through the "Bonsai Workflows" section if you are not familiar with using Harp devices in Bonsai. + +Alternatively, if you have experience with Harp devices, you can check the [register table](xref:Harp.Behavior) in the reference to access the device functionality directly. + +[!INCLUDE [](version-footer.md)] + + +[`Behavior (Device)`]: xref:Harp.Behavior.Device +[`BehaviorDataWriter (DeviceDataWriter)`]: xref:Harp.Behavior.DeviceDataWriter +[`AnalogData`]: xref:Harp.Behavior.AnalogData diff --git a/docs/articles/installation.md b/docs/articles/installation.md new file mode 100644 index 0000000..e9d92e3 --- /dev/null +++ b/docs/articles/installation.md @@ -0,0 +1,70 @@ +## Installation + +This page covers the software you'll need to interact with the Behavior board, as well as how to update the firmware on the device. + +### Software Packages + +These steps are only required the first time you connect the device to a new computer, and you can install just the packages for the functionality you need. + +# [Bonsai](#tab/bonsai) + +[Bonsai](https://bonsai-rx.org/) is a visual reactive programming language that provides flexible and comprehensive control of the Behavior board. + +![Bonsai Package Manager](../images/bonsai-packagemanager.png){width=600} + +- Download and install [Bonsai](https://bonsai-rx.org/docs/articles/installation.html). +- Launch Bonsai and install the `Harp.Behavior` package by searching for it in the [Bonsai package manager](https://bonsai-rx.org/docs/articles/packages.html). +- (Optional) Install the `Bonsai.Windows.Input` package to follow along with the examples in this user guide. + +# [Python](#tab/python) + +The [Harp](https://harp-tech.org/python/) library provides a Python interface for controlling Harp devices and [loading](logging-analysis.md) recorded data. To install the full library, install it in a Python environment with: + +```cmd +pip install harp +``` + +To install only the package necessary for loading data: + +```cmd +pip install harp-data +``` + +> [!NOTE] +> Substitute `uv add` for `pip install` if you are using the [uv](https://docs.astral.sh/uv/) package manager. + +# [GUI](#tab/gui) + +The [Behavior GUI](behavior-gui.md) is a standalone graphical application for configuring and testing the device without using Bonsai. + +![Behavior GUI](../images/behavior-gui.png){width=600} + +- Download and install the [Behavior GUI](https://github.com/fchampalimaud/device.behavior/releases). + +*** + +### Firmware Update + +New features are added and bugs are fixed with firmware updates which are published on the [release page](https://github.com/harp-tech/device.behavior/releases) in the device GitHub repository. Each release contains a `.hex` file tagged with the firmware (`fw`) and hardware (`hw`) version. For instance, `Behavior-fw3.3-harp1.15-hw2.1-ass0.hex` is firmware v3.3 for a hardware v2.1 Behavior board. Download the latest firmware version that matches the hardware version of the board from the "Assets" section under each release. + +>[!TIP] +> The hardware version is printed on the PCB silkscreen (e.g. `harp behavior v2.1`). + +To update the firmware, use the device setup tool in Bonsai: + +![Device Setup](../images/installation-firmwareupdate.png){width=650} + +1. Add the [`Device`] operator in Bonsai. +2. Double-click on the [`Device`] node while the workflow is not running. +3. Select the COM port for the device. +4. Click "Bootloader". +5. Click "Open". +6. Select the downloaded `.hex` file. +7. Click "Update". + +After the update, the device will reboot with the new firmware. + +[!INCLUDE [](version-footer.md)] + + +[`Device`]: xref:Harp.Behavior.Device diff --git a/docs/articles/logging-analysis.md b/docs/articles/logging-analysis.md new file mode 100644 index 0000000..8c087dd --- /dev/null +++ b/docs/articles/logging-analysis.md @@ -0,0 +1,57 @@ +## Logging and Analysis + +This article covers how data from the device is logged to disk, and how to read and plot the logged data with the [`harp-data`](installation.md#software-packages) Python package. + +### Log Data + +Data from the device is logged by the [`DeviceDataWriter`] operator in the Harp device pattern, which saves raw data from all device registers in the Harp binary format to the folder set in its `Path` property: + +:::workflow +![Harp Device Pattern](../workflows/harp-devicepattern.bonsai) +::: + +While the workflow is running, registers are logged as the device produces messages (events and command echoes). Two properties of the [`Device`] operator are also important for logging: + +- `DumpRegisters` - Enabled by default, this property logs a read of every register when the device initializes, capturing the initial state of the device at the start of the experiment. +- `Heartbeat` - Disabled by default, enable it to regularly log the device's hardware timestamp. The Behavior board's own 1 kHz [`AnalogData`](acquire-analog-data.md) stream can perform the same function while it is enabled. + +> [!WARNING] +> The register dump can be used as an approximate start time for the workflow or experiment, but keep in mind that other devices in the workflow may initialize at a different time. + +### Analyze Data + +The [`harp-data`](https://harp-tech.org/python/) package imports data stored in the Harp binary format as [pandas](https://pandas.pydata.org/) DataFrames, which can then be analyzed with any `pandas` compatible plotting or analysis library. + +The following example demonstrates how to read and plot data from the [`AnalogData`](acquire-analog-data.md) register. + +> [!NOTE] +> This example requires a Python environment with [harp-data](installation.md#software-packages) and [`matplotlib`](https://matplotlib.org/) (used by `pandas` as a plotting backend) installed. + +```python +# Import the dependencies +import matplotlib.pyplot as plt +from harp import data + +# Finds device.yml in the folder, builds the device module, returns a dataset reader +reader = data.open_dataset("Behavior.harp") + +# Lists every register in the reader by name and address +print(reader.contents) + +# Load data from a particular register +df = reader.read("AnalogData") # by name +df = reader.read(44) # or by address + +# Inspect DataFrame +print(df.head()) + +# Plot the analog data +df.plot() +plt.show() +``` + +[!INCLUDE [](version-footer.md)] + + +[`DeviceDataWriter`]: xref:Harp.Behavior.DeviceDataWriter +[`Device`]: xref:Harp.Behavior.Device diff --git a/docs/articles/mimic-poke-signals.md b/docs/articles/mimic-poke-signals.md new file mode 100644 index 0000000..4f6782e --- /dev/null +++ b/docs/articles/mimic-poke-signals.md @@ -0,0 +1,86 @@ +## Mimic Poke Signals + +The Behavior board can mimic or mirror the poke peripheral's infrared port inputs and valve output on other output lines. This is useful for triggering external equipment directly or recording reward delivery on an external acquisition system and avoids round-trip latency from going through the computer. + +Refer to the [connections](./connections.md?tabs=poke#connections) article to set up the [Mice Poke](./peripherals/peripherals-micepoke.md) peripheral on port **P0** and connect an indicator (like an LED) to **DO0**, which we will use for the rest of the examples. + +> [!WARNING] +> Due to a bug in the current firmware (v3.3), only `DO0` and `DO2` can be used as mimic targets. + +This article covers how to mimic poke inputs and valve outputs in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Mimic Poke Signals](../workflows/mimicpokesignals-toplevel.bonsai) +::: + +### Mimic Poke Inputs + +Set a mimic target output line for the poke's infrared inputs with the [`MimicPort0IR`] register (ports 1 and 2 have their own counterparts). + +:::workflow +![Mimic Poke Inputs](../workflows/mimicpokesignals-mimicir.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `MimicPort0IRPayload`. + - `MimicPort0IR` - Select `DO0` for the target output line. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `MimicPort0IRPayload`. + - `MimicPort0IR` - Select `None`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press A to enable the mimic target, and trigger the infrared poke detector on **P0**. The indicator on **DO0** should follow the beam state. Press S to remove the mimic target configuration. + +> [!WARNING] +> A mimic target line still responds to commands that modify digital outputs, such as [`OutputSet`] and [`OutputClear`]. Other mimic registers can also select the same target. To avoid conflicts, dedicate each mimic target to a single source and clear any left over configurations. + +### Mimic Poke Valves + +Similarly, to mimic the valve output, set a mimic target in the [`MimicPort0Valve`] register. + +:::workflow +![Mimic Poke Valves](../workflows/mimicpokesignals-mimicvalve.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `MimicPort0ValvePayload`. + - `MimicPort0Valve` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `MimicPort0ValvePayload`. + - `MimicPort0Valve` - Select `None`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +To trigger the valve output, send an [`OutputSet`] command in a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `G`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `SupplyPort0` to open the **P0** valve. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press D, then press G to open the **P0** valve. **DO0** follows the valve state, including [timed pulses](control-digital-outputs.md#pulse-outputs). Press F to remove the mimic target configuration. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`MimicPort0IR`]: xref:Harp.Behavior.MimicPort0IR +[`MimicPort0Valve`]: xref:Harp.Behavior.MimicPort0Valve +[`OutputSet`]: xref:Harp.Behavior.OutputSet +[`OutputClear`]: xref:Harp.Behavior.OutputClear diff --git a/docs/articles/outputpulseenable-warning.md b/docs/articles/outputpulseenable-warning.md new file mode 100644 index 0000000..82d43b6 --- /dev/null +++ b/docs/articles/outputpulseenable-warning.md @@ -0,0 +1,2 @@ +> [!WARNING] +> [`OutputPulseEnable`](xref:Harp.Behavior.OutputPulseEnable) is a selection mask over all digital outputs, any output not selected in the payload has its pulse mode disabled. Make sure to list every output that should keep pulse mode (e.g. `DO0`, `SupplyPort0`). diff --git a/docs/articles/peripherals/peripherals-micepoke.md b/docs/articles/peripherals/peripherals-micepoke.md new file mode 100644 index 0000000..91ebd42 --- /dev/null +++ b/docs/articles/peripherals/peripherals-micepoke.md @@ -0,0 +1,34 @@ +## Mice Poke + +The Harp Behavior Mice Poke is a nose-poke peripheral for the Behavior board. It detects pokes with an infrared beam, drives onboard cue LEDs, and controls a solenoid valve for reward delivery. Refer to the [connections](../connections.md?tabs=poke#connections) article to set up the peripheral and the [Control Poke Peripheral](../control-poke.md) article to use it in Bonsai. + +![Mice Poke With Water Valve](../../images/OEPS-MicePokeWaterValve.jpg){width=450} + +### Key Features + +- Infrared beam poke detection. +- Control of 2 onboard LEDs, with the option of connecting an external LED. +- 12 V solenoid valve control for reward delivery. + +### Specs + +- Connector: RJ45 for direct connection with Behavior board peripheral port, screw terminals for operating the peripheral with other external devices + +### Hardware + +| Version | Compatible Behavior Board | Notes | +| ------- | ------------------------- | ----- | +| 1.4 | > 1.0 |
  • Update valve footprint
  • Increased LED resistor
| +| 1.3 | > 1.0 |
  • Screw terminals consolidated into a single block
  • Added infrared beam and photodiode access on the screw terminals
| +| 1.2 | > 1.0 |
  • Initial version
| + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp), or build your own using the hardware design files in the [Mice Poke](https://github.com/harp-tech/peripheral.micepoke) repository. + + +> [!NOTE] +> Three variants are available from the Open Ephys store, choose the right variant for your needs: +> - OEPS-3007 - PCB only +> - OEPS-3008 - Includes mice poke enclosure, no water valve +> - OEPS-3010 - Includes mice poke enclosure and water valve + +[!INCLUDE [](../version-footer.md)] diff --git a/docs/articles/peripherals/peripherals-photodiode.md b/docs/articles/peripherals/peripherals-photodiode.md new file mode 100644 index 0000000..13dd689 --- /dev/null +++ b/docs/articles/peripherals/peripherals-photodiode.md @@ -0,0 +1,27 @@ +## Photodiode + +The Harp Behavior Photodiode is a light-measuring peripheral for the Behavior board. It outputs either an analog signal of the light intensity or a thresholded digital pulse, for instance to detect stimulus onsets on a screen. Refer to the [connections](../connections.md?tabs=photodiode#connections) article to set up the peripheral and the [Acquire Analog Data](../acquire-analog-data.md) or [Read Digital Inputs](../read-digital-inputs.md) articles to read its output in Bonsai. + +![Photodiode](../../images/OEPS-Photodiode.jpg){width=450} + +### Key Features + +- Onboard photodiode. +- Jumper setting to switch between analog output (**ANA**) or digital output (**DIG**). +- Adjustment screw to set the threshold for digital output. +- Powered from the Behavior board's 5 V supply. + +### Specs + +- Photodiode: Advanced Photonix PDB-C156-ND +- Connector: 3.5 mm stereo jack for stereo plug cable carrying 5 V, ground and signal wire + +### Hardware + +| Version | Compatible Behavior Board | Notes | +| ------- | ------------------------- | ----- | +| 2.3 | > 1.0 |
  • Initial version
| + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp). + +[!INCLUDE [](../version-footer.md)] diff --git a/docs/articles/peripherals/peripherals-portbreakout.md b/docs/articles/peripherals/peripherals-portbreakout.md new file mode 100644 index 0000000..30c2182 --- /dev/null +++ b/docs/articles/peripherals/peripherals-portbreakout.md @@ -0,0 +1,47 @@ +## Breakout + +The Harp Behavior Breakout is an interface peripheral for the Behavior board. It makes the pins of the Behavior board peripheral ports available on screw terminals without having to build a custom cable. Refer to the [connections](../connections.md?tabs=breakout#connections) article to set up the peripheral and the [Read Digital Inputs](../read-digital-inputs.md), [Control Digital Outputs](../control-digital-outputs.md), or [Stream Timestamps](../advanced-configuration.md#stream-timestamps) articles to use it in Bonsai. + +![Breakout board v1.1](../../images/OEPS-Breakout.png){width=350} ![Breakout board v2.1](../../images/OEPS-Breakoutv2.1.png){width=350} + +*Left: Breakout v1.1. Right: Breakout v2.1.* + +### Key Features + +- Supports 12 V solenoid valves (e.g. Lee LHD series) (v1.1 only). +- Supports serial timestamp output, with the logic level selected by the onboard jumper (v2.x only). + +> [!NOTE] +> Pick the board version by the feature you need, both features are not available on the same board as they share the same port line. + +### Specs + +Ports: +- 1x Digital Input (DI) +- 1x Digital Input / Output (DIO) +- 1x Digital Output (DO) +- 1x 5V supply (+5V) +- 1x Ground (GND) +- 1x 12 V supply (+12V) (v1.1 only) +- 1x Supply return (compatible for +5V and +12V) (SUP_RTN) (v1.1 only) +- 1x Serial TX (v2.x only) + +For connection with a quadrature encoder: + +| Quadrature Encoder Pin | Breakout Board Pin | +| ---------------------- | ------------------ | +| A | DI | +| B | DIO | +| Supply | +5V | +| Ground | GND | + +### Hardware + +| Version | Compatible Behavior Board | Notes | +| ------- | ------------------- | ----- | +| 2.x | > 2.0 |
  • Serial TX terminal replaces the +12V and SUP_RTN terminals
  • TX logic level jumper-selectable between 3.3 V and 5 V
| +| 1.1 | > 1.2 |
  • Initial version
| + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp), or build your own using the hardware design files in the [Breakout](https://github.com/harp-tech/peripheral.portbreakout) repository. + +[!INCLUDE [](../version-footer.md)] diff --git a/docs/articles/peripherals/peripherals-rotaryencoder.md b/docs/articles/peripherals/peripherals-rotaryencoder.md new file mode 100644 index 0000000..8938643 --- /dev/null +++ b/docs/articles/peripherals/peripherals-rotaryencoder.md @@ -0,0 +1,27 @@ +## Rotary Encoder + +The Harp Behavior Rotary Encoder is a rotation tracking peripheral for the Behavior board. It plugs directly into peripheral port **P2**, the only port with a quadrature counter. It can be used, for instance, to track the rotation of a running wheel. Refer to the [connections](../connections.md?tabs=encoder#connections) article to set up the peripheral and the [Track Rotary Encoder](../track-rotary-encoder.md) article to use it in Bonsai. + +![Rotary Encoder](../../images/OEPS-RotaryEncoder.jpg){width=450} + +### Key Features + +- Onboard quadrature rotary encoder. +- Solder pads for wiring an external quadrature encoder to use instead of the onboard one. + +### Specs + +- Encoder: Alps Alpine EC12E24204A9 (mechanical, 24 pulses per revolution, with detents) +- Connector: RJ45 for direct connection to a Behavior board peripheral port + +### Hardware + +| Version | Compatible Behavior Board | Notes | +| ------- | ------------------- | ----- | +| 1.3 | > 1.0 |
  • Fixed encoder direction
| +| 1.2 | > 1.0 |
  • Replaced the optical encoder with an Alps Alpine EC12E24204A9 mechanical encoder
  • Added pull-ups and filtering on the quadrature channels
| +| 1.0 | > 1.0 |
  • Initial version, using a Bourns ENC1J-D28-L00128 optical encoder (128 pulses per revolution)
| + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp). + +[!INCLUDE [](../version-footer.md)] diff --git a/docs/articles/peripherals/peripherals-speaker.md b/docs/articles/peripherals/peripherals-speaker.md new file mode 100644 index 0000000..5fe9af7 --- /dev/null +++ b/docs/articles/peripherals/peripherals-speaker.md @@ -0,0 +1,35 @@ +## Speaker + +The Harp Behavior Speaker is a sound output peripheral for the Behavior board. It connects to one of the general-purpose digital outputs and turns the board's PWM signal into an audible tone. Refer to the [connections](../connections.md?tabs=speaker#connections) article to set up the peripheral and the [Generate PWM](../generate-pwm.md) article to use it in Bonsai. + +![Speaker](../../images/OEPS-Speaker.jpg){width=450} + +> [!NOTE] +> The Harp Behavior Speaker is meant for playback of simple tones. For audio stimulation with complex stimuli and high precision, consider using the Harp [Sound Card](https://github.com/harp-tech/device.soundcard). + +### Key Features + +- Onboard speaker driven directly by a digital output. +- Volume potentiometer to adjust the amplitude. +- Screw terminal for wiring, no soldering needed. + +### Specs + +- Input signal: 5 V PWM +- Speaker: PUI Audio AST-03208MR-R +- Frequency range: 500 Hz–10 kHz +- Connector: Screw terminal + +> [!NOTE] +> While the speaker can go higher in range, the [PWM signal generation](../generate-pwm.md) on the Behavior board has a 10 kHz upper limit. + +### Hardware + +| Version | Compatible Behavior Board | Notes | +| ------- | ------------------- | ----- | +| 1.2 | > 1.0 |
  • Fixed the volume direction
| +| 1.1 | > 1.0 |
  • Initial version
| + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp). + +[!INCLUDE [](../version-footer.md)] diff --git a/docs/articles/peripherals/toc.yml b/docs/articles/peripherals/toc.yml new file mode 100644 index 0000000..d12cd1e --- /dev/null +++ b/docs/articles/peripherals/toc.yml @@ -0,0 +1,10 @@ +- name: Mice Poke + href: peripherals-micepoke.md +- name: Breakout + href: peripherals-portbreakout.md +- name: Rotary Encoder + href: peripherals-rotaryencoder.md +- name: Speaker + href: peripherals-speaker.md +- name: Photodiode + href: peripherals-photodiode.md diff --git a/docs/articles/read-digital-inputs.md b/docs/articles/read-digital-inputs.md new file mode 100644 index 0000000..d246e46 --- /dev/null +++ b/docs/articles/read-digital-inputs.md @@ -0,0 +1,69 @@ +## Read Digital Inputs + +The Behavior board has one digital input that is accessible without extra hardware: **DI3** on the **Input** connector (hardware v2.0 or later boards only). Each peripheral port also carries a general-purpose **DI** line, and a **DIO** line that can be used as an active-low digital input. Refer to the [connections](./connections.md?tabs=digitalinput#connections) article to set up the hardware connection on **DI3** or **DIO0**, which we will use for the rest of these examples. + +This article covers how to visualize the digital input events and read the peripheral port **DIO** lines as a digital input in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Read Digital Inputs](../workflows/readdigitalinputs-toplevel.bonsai) +::: + +[!INCLUDE [](breakout-note.md)] + +### Visualize Digital Input Events + +The Behavior board broadcasts changes on its digital input lines as [`DigitalInputState`] event messages. In addition to **DI3**, this register also reports events from the **DI** lines on the peripheral ports **P0**–**P2** (represented as `DIPort0`–`DIPort2` in Bonsai), such as [poke events](control-poke.md) from the [Mice Poke](./peripherals/peripherals-micepoke.md) peripheral or other digital inputs connected to the [Breakout](./peripherals/peripherals-portbreakout.md) board. The workflow below subscribes, parses, and displays them in a visualizer window. + +:::workflow +![Read Digital Inputs Visualize](../workflows/controlpoke-visualizeevents.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. This will listen to [`HarpMessages`] broadcast from the [`PublishSubject`] named `Behavior Events` in the Harp device pattern. +- Insert a [`Parse`] operator and configure the `Register` property to `TimestampedDigitalInputState`. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the parsed events when the workflow starts. + +Run the workflow and drive the **DI3** line high. The visualizer will display: + +```text +DI3@12.001504 +None@12.301823 +``` + +The first value is the payload, listing the digital inputs that are currently active, and the second value is the timestamp on the device clock. Both rising and falling edges generate an event, so `None` marks the moment the line returned low. + +> [!NOTE] +> The [`PokeInputFilter`](control-poke.md#configure-input-filter) debounce applies only to the peripheral port inputs; **DI3** events are not filtered. + +### Visualize Port DIO Events + +In the current firmware (v3.3) the **DIO** line acts only as an active-low digital input. It idles high at 5 V through onboard pull-ups, and the connected device must actively drive it low. Changes on the **DIO** lines are broadcast in a different register, [`PortDIOStateEvent`], which can be visualized in the same way as the digital inputs: + +:::workflow +![Read Digital Inputs Visualize Port DIO](../workflows/readdigitalinputs-visualizeportdio.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`Parse`] operator and configure the `Register` property to `TimestampedPortDIOStateEvent`. +- Insert a [`VisualizerWindow`] operator. + +Run the workflow and drive the **DIO** line on **P0** low. The visualizer will display: + +```text +DIO0, DIO1, DIO2@20.154016 +DIO1, DIO2@20.575872 +``` + +The payload lists the **DIO** lines that are currently high. Since the lines idle high, driving **DIO0** low removes it from the list, and releasing the line adds it back. + +[!INCLUDE [](version-footer.md)] + + +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`PublishSubject`]: xref:Bonsai.Reactive.PublishSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`HarpMessages`]: xref:Bonsai.Harp.HarpMessage +[`DigitalInputState`]: xref:Harp.Behavior.DigitalInputState +[`PortDIOStateEvent`]: xref:Harp.Behavior.PortDIOStateEvent diff --git a/docs/articles/toc.yml b/docs/articles/toc.yml index ebe36f8..06c6bcf 100644 --- a/docs/articles/toc.yml +++ b/docs/articles/toc.yml @@ -1,2 +1,48 @@ - name: Introduction - href: ../index.md \ No newline at end of file +- name: Overview + href: ../index.md +- name: Specs +- name: Behavior Board + href: behavior-overview.md +- name: Peripherals + href: ./peripherals/toc.yml +- name: Getting Started +- name: Ports and Connections + href: connections.md +- name: Installation + href: installation.md +- name: Behavior GUI + href: behavior-gui.md +- name: Bonsai + href: harp-bonsai.md +- name: Bonsai Workflows +- name: About These Examples + href: about-these-examples.md +- name: Acquire Analog Data + href: acquire-analog-data.md +- name: Read Digital Inputs + href: read-digital-inputs.md +- name: Control Digital Outputs + href: control-digital-outputs.md +- name: Generate PWM + href: generate-pwm.md +- name: Control LEDs + href: control-leds.md +- name: Control Poke Peripheral + href: control-poke.md +- name: Mimic Poke Signals + href: mimic-poke-signals.md +- name: Track Rotary Encoder + href: track-rotary-encoder.md +- name: Trigger Cameras + href: trigger-cameras.md +- name: Drive Servos + href: drive-servos.md +- name: Advanced Configuration + href: advanced-configuration.md +- name: Data Management +- name: Logging and Analysis + href: logging-analysis.md +- name: Troubleshooting +- name: Errors + href: troubleshooting.md diff --git a/docs/articles/track-rotary-encoder.md b/docs/articles/track-rotary-encoder.md new file mode 100644 index 0000000..1c2121d --- /dev/null +++ b/docs/articles/track-rotary-encoder.md @@ -0,0 +1,83 @@ +## Track Rotary Encoder + +The **P2** peripheral port of the Behavior board has an encoder mode that allows it to read a quadrature encoder (e.g. to track the rotation of a treadmill). Refer to the [connections](./connections.md?tabs=encoder#connections) article to set up either the [Rotary Encoder](./peripherals/peripherals-rotaryencoder.md) peripheral or attach an external quadrature encoder to the [Breakout](./peripherals/peripherals-portbreakout.md) board. + +This article covers enabling the encoder mode, visualizing the reading, and resetting the count. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Track Rotary Encoder](../workflows/trackrotaryencoder-toplevel.bonsai) +::: + +### Enable the Encoder + +The encoder mode is disabled by default and needs to be enabled with the [`EnableEncoders`] register. The reading can either reflect position or displacement, which is set with [`EncoderMode`]. + +:::workflow +![Enable the Encoder](../workflows/trackrotaryencoder-enable.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EncoderModePayload`. + - `EncoderMode` - Select `Position` to stream the accumulated count, or `Displacement` to stream the change since the previous sample. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EnableEncodersPayload`. + - `EnableEncoders` - Select `EncoderPort2` to enable the encoder. To disable the encoder in the future, select `None`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A to enable the encoder. + +> [!WARNING] +> While the encoder is enabled, **P2** repurposes its infrared and DIO lines as the quadrature inputs: poke events from **P2** are suspended until the encoder is disabled. + +### Visualize Encoder Reading + +The counter is then streamed in the `Encoder` field of the 1 kHz [`AnalogData`](acquire-analog-data.md) events. + +:::workflow +![Visualize Encoder Reading](../workflows/trackrotaryencoder-visualize.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`Parse`] operator and configure the `Register` property to `AnalogData`. +- Right-click on the [`Parse`] operator, select the "Output (Harp.Behavior.AnalogDataPayload)" > "Encoder" option from the context menu. This will create a `Encoder` node. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the encoder count when the workflow starts. + +Run the workflow, press A to enable the encoder if it is disabled, and turn the encoder shaft. The visualizer plots the count going up in one direction and down in the other. + +> [!WARNING] +> In `Position` mode the count is a signed 16-bit value that ranges from -32768 to 32767 and wraps around silently when it passes either end. If the count is likely to hit those limits, reset the count every session or switch to `Displacement` mode and accumulate the per-sample changes in Bonsai with an [`Accumulate`] operator. + +### Reset the Encoder + +The [`EncoderReset`] register sets the counter of the selected encoders back to zero: + +:::workflow +![Reset the Encoder](../workflows/trackrotaryencoder-reset.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EncoderResetPayload`. + - `EncoderReset` - Select `EncoderPort2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press S. The `Encoder` value in the analog stream returns to zero. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`Accumulate`]: xref:Bonsai.Reactive.Accumulate +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`EnableEncoders`]: xref:Harp.Behavior.EnableEncoders +[`EncoderMode`]: xref:Harp.Behavior.EncoderMode +[`EncoderReset`]: xref:Harp.Behavior.EncoderReset +[`AnalogData`]: xref:Harp.Behavior.AnalogData diff --git a/docs/articles/trigger-cameras.md b/docs/articles/trigger-cameras.md new file mode 100644 index 0000000..345d4e6 --- /dev/null +++ b/docs/articles/trigger-cameras.md @@ -0,0 +1,93 @@ +## Trigger Cameras + +The Behavior board can generate TTL signals for cameras that support external triggering on **DO0** and **DO1**. This is useful for synchronizing multiple cameras and capturing camera frame timestamps on the device clock. Refer to the [connections](./connections.md?tabs=camera#connections) article to set up a compatible camera on **DO1**, which we will use for the rest of these examples. + +This article covers how to configure the trigger frequency, start and stop the cameras, and visualize frame events in Bonsai. + +The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below. + +:::workflow +![Trigger Cameras](../workflows/triggercameras-toplevel.bonsai) +::: + +> [!TIP] +> Configure your camera to trigger on the rising edge of the pulse, and avoid modes that use the trigger pulse width to control exposure. Check that the voltage level is compatible with the camera's external trigger voltage level. The trigger signal is a 5 V square wave with a 50% duty cycle and the pulse width is not configurable. + +### Configure Trigger Frequency + +The trigger frequency of each camera is set with the appropriate register for the port, e.g. [`Camera1Frequency`] for **DO1**: + +:::workflow +![Configure Trigger Frequency](../workflows/triggercameras-frequency.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `Camera1FrequencyPayload`. + - `Camera1Frequency` - Set the trigger frequency in Hz (e.g. 30). Valid values are 2 to 600. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A to set the trigger frequency. Configure the frequency before starting the camera. Once camera triggering starts, the frequency cannot be modified without stopping the camera. + +### Start and Stop Cameras + +Enable and disable the camera triggering with the [`StartCameras`] and [`StopCameras`] registers: + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `StartCamerasPayload`. + - `StartCameras` - Select `CameraOutput1` for the camera connected to **DO1**. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `StopCamerasPayload`. + - `StopCameras` - Select `CameraOutput1` for the camera connected to **DO1**. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press S to start the camera trigger on **DO1** and D to stop it. Check the image stream in either Bonsai with a camera source operator like [`CameraCapture`] or in your camera vendor's acquisition software to confirm that the external trigger is working. + +> [!NOTE] +> Camera triggering stops automatically when the Bonsai workflow stops and the device goes into standby mode. This behavior is specific to camera triggering, other digital outputs keep their last state when the workflow stops. Remember to start the camera trigger again when you restart the workflow. + +### Visualize Frame Events + +Each trigger pulse broadcasts a frame event tied to the port like [`Camera1Frame`]. Use it to verify that the trigger signal is being generated. Each message will also carry the recorded timestamp for the pulse on the device clock: + +:::workflow +![Visualize Frame Events](../workflows/triggercameras-visualizeframes.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`Parse`] operator and configure the `Register` property to `TimestampedCamera1Frame`. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the parsed events when the workflow starts. + +Run the workflow and press S. The visualizer displays: + +```text +FrameAcquired@10.351072 +``` + +The first value confirms the frame trigger and the second is the timestamp on the device clock. Match the [logged](./logging-analysis.md) timestamps against the frames saved by your video capture software to align video with the rest of the data. + + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CameraCapture`]: xref:Bonsai.Vision.CameraCapture +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`Camera1Frequency`]: xref:Harp.Behavior.Camera1Frequency +[`StartCameras`]: xref:Harp.Behavior.StartCameras +[`StopCameras`]: xref:Harp.Behavior.StopCameras +[`Camera1Frame`]: xref:Harp.Behavior.Camera1Frame diff --git a/docs/articles/troubleshooting.md b/docs/articles/troubleshooting.md new file mode 100644 index 0000000..06d90a4 --- /dev/null +++ b/docs/articles/troubleshooting.md @@ -0,0 +1,34 @@ +## Errors + +This article covers how to resolve common connection errors on the Behavior board. + +### COM Port Errors + +**Q: In Bonsai, running the workflow throws an error "The port `ComX` does not exist."** + +A: Either the wrong communications port in the `PortName` property in [`Device`] was selected, or the [USB](connections.md) cable is not properly connected. Try selecting a different communications port and checking the connection. + +**Q: In Bonsai, running the workflow throws an error "Access to the port `ComX` is denied"** + +A: Only one interface connection to the Behavior board can be opened at one time. Check that multiple instances of Bonsai are not running, and that the [Behavior GUI](behavior-gui.md) is closed. Sometimes, the port can also be locked by a program that did not terminate correctly; restarting the computer fixes it. + +### Device Errors + +**Q: Poke events stopped arriving from P2.** + +A: One possible reason is that the [quadrature encoder](track-rotary-encoder.md) is enabled, as **P2** repurposes its input lines for the quadrature counter. Disable the encoder to restore poke detection. + +**Q: An external device does not detect the low state of a digital output. The line reads 5 V when the output is set, but does not reach 0 V when it is cleared.** + +A: The input line on the external device might have low impedance. The **DO0**–**DO3** outputs are designed for high-impedance inputs and return to 0 V through a passive pull-down resistor. Try using the peripheral port digital outputs with the [Breakout](./peripherals/peripherals-portbreakout.md) board, as those pins have an actively driven low state. + +Also check that the ground connection is shared between the devices, as improper grounding can produce offset voltage levels in the low state. + +**Q: How do I use the DIO pins on the peripheral ports as digital outputs?** + +A: The **DIO** line on ports **P0**–**P2** work as a digital input in the current firmware (v3.3), as the functionality to switch the pins from digital input to digital output have not been implemented yet. Refer to the [Read Digital Inputs](./read-digital-inputs.md) article to read those pins. + +[!INCLUDE [](version-footer.md)] + + +[`Device`]: xref:Harp.Behavior.Device diff --git a/docs/articles/version-footer.md b/docs/articles/version-footer.md new file mode 100644 index 0000000..2c3fdbd --- /dev/null +++ b/docs/articles/version-footer.md @@ -0,0 +1,8 @@ +
+ +--- + +Last updated with:
+**Hardware** v2.1
+**Firmware** v3.3
+**Bonsai Package** v0.2 diff --git a/docs/images/OEPS-BehaviorBoard.jpg b/docs/images/OEPS-BehaviorBoard.jpg new file mode 100644 index 0000000..706a73f Binary files /dev/null and b/docs/images/OEPS-BehaviorBoard.jpg differ diff --git a/docs/images/OEPS-Breakout.png b/docs/images/OEPS-Breakout.png new file mode 100644 index 0000000..ee2dc30 Binary files /dev/null and b/docs/images/OEPS-Breakout.png differ diff --git a/docs/images/OEPS-Breakoutv2.1.png b/docs/images/OEPS-Breakoutv2.1.png new file mode 100644 index 0000000..8036884 Binary files /dev/null and b/docs/images/OEPS-Breakoutv2.1.png differ diff --git a/docs/images/OEPS-MicePokeWaterValve.jpg b/docs/images/OEPS-MicePokeWaterValve.jpg new file mode 100644 index 0000000..52f7864 Binary files /dev/null and b/docs/images/OEPS-MicePokeWaterValve.jpg differ diff --git a/docs/images/OEPS-Photodiode.jpg b/docs/images/OEPS-Photodiode.jpg new file mode 100644 index 0000000..ca1cde7 Binary files /dev/null and b/docs/images/OEPS-Photodiode.jpg differ diff --git a/docs/images/OEPS-RotaryEncoder.jpg b/docs/images/OEPS-RotaryEncoder.jpg new file mode 100644 index 0000000..173a9d5 Binary files /dev/null and b/docs/images/OEPS-RotaryEncoder.jpg differ diff --git a/docs/images/OEPS-Speaker.jpg b/docs/images/OEPS-Speaker.jpg new file mode 100644 index 0000000..dace600 Binary files /dev/null and b/docs/images/OEPS-Speaker.jpg differ diff --git a/docs/images/behavior-GUI.png b/docs/images/behavior-GUI.png new file mode 100644 index 0000000..e3ae7ad Binary files /dev/null and b/docs/images/behavior-GUI.png differ diff --git a/docs/images/behavior-devicepinout.svg b/docs/images/behavior-devicepinout.svg new file mode 100644 index 0000000..7f8bad8 --- /dev/null +++ b/docs/images/behavior-devicepinout.svg @@ -0,0 +1,395 @@ + + + +OutputInputL0, L1RGBP0, P1, P2 ADC12V PWRUSBCLKINState diff --git a/docs/images/behavior-peripherals.svg b/docs/images/behavior-peripherals.svg new file mode 100644 index 0000000..fdc2a60 --- /dev/null +++ b/docs/images/behavior-peripherals.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + +2x Cameras +2x Servos +1x Encoder +2x LEDsup to 100 mA +2x RGBs +4x Speakers +3x Pokes, Valves and LEDs +1x Photodiode(sync with visual stimuli) +Harp Behavior + diff --git a/docs/images/bonsai-packagemanager.png b/docs/images/bonsai-packagemanager.png new file mode 100644 index 0000000..d2ce698 Binary files /dev/null and b/docs/images/bonsai-packagemanager.png differ diff --git a/docs/images/connection-analoginput.svg b/docs/images/connection-analoginput.svg new file mode 100644 index 0000000..55bea63 --- /dev/null +++ b/docs/images/connection-analoginput.svg @@ -0,0 +1,362 @@ + + + +AD1GNDDI3GNDAD0GND+5VGNDAOExternal device sending analog signal≥ v2.0 only diff --git a/docs/images/connection-breakout.svg b/docs/images/connection-breakout.svg new file mode 100644 index 0000000..6ffc55d --- /dev/null +++ b/docs/images/connection-breakout.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + +v1.1 + +SUP_RTN + ++12V + +GND + +DI + +DIO + +DO + +GND + ++5V + + + + + + +v2.x + +TX + +DI + +DIO + +DO + +GND + ++5V + + + + + + + + + + + + diff --git a/docs/images/connection-camera.svg b/docs/images/connection-camera.svg new file mode 100644 index 0000000..6576be2 --- /dev/null +++ b/docs/images/connection-camera.svg @@ -0,0 +1,178 @@ + + +DO3DO2GNDDO1DO0GNDINGND diff --git a/docs/images/connection-digitalinput.svg b/docs/images/connection-digitalinput.svg new file mode 100644 index 0000000..2643e2c --- /dev/null +++ b/docs/images/connection-digitalinput.svg @@ -0,0 +1,214 @@ + + + +AD1GNDDI3GNDDOExternal device sending digital signal≥ v2.0 only diff --git a/docs/images/connection-digitaloutput.svg b/docs/images/connection-digitaloutput.svg new file mode 100644 index 0000000..f50fa8e --- /dev/null +++ b/docs/images/connection-digitaloutput.svg @@ -0,0 +1,228 @@ + + +DO3DO2GNDDO1DO0GNDGNDDIExternal device receiving digital signal diff --git a/docs/images/connection-encoder.svg b/docs/images/connection-encoder.svg new file mode 100644 index 0000000..33ee63b --- /dev/null +++ b/docs/images/connection-encoder.svg @@ -0,0 +1,58 @@ + + ++AB-For external use only diff --git a/docs/images/connection-harpsynchronization.svg b/docs/images/connection-harpsynchronization.svg new file mode 100644 index 0000000..139a761 --- /dev/null +++ b/docs/images/connection-harpsynchronization.svg @@ -0,0 +1,59 @@ + + +CLKINCLKOUTCLKIN \ No newline at end of file diff --git a/docs/images/connection-led.svg b/docs/images/connection-led.svg new file mode 100644 index 0000000..7fc8865 --- /dev/null +++ b/docs/images/connection-led.svg @@ -0,0 +1,56 @@ + + +AKAKL1L05VSGAK++SS--++SS-- diff --git a/docs/images/connection-photodiode.svg b/docs/images/connection-photodiode.svg new file mode 100644 index 0000000..761858c --- /dev/null +++ b/docs/images/connection-photodiode.svg @@ -0,0 +1,312 @@ + + + +AD1GNDDI3GNDAD0GND+5VSIGNALGND+5 V≥ v2.0 only diff --git a/docs/images/connection-poke.svg b/docs/images/connection-poke.svg new file mode 100644 index 0000000..2bf1a30 --- /dev/null +++ b/docs/images/connection-poke.svg @@ -0,0 +1,64 @@ + + +DIO1IR LEDGNDIR PHTGNDLEDGND+5VVALVEFor external use only diff --git a/docs/images/connection-servo.svg b/docs/images/connection-servo.svg new file mode 100644 index 0000000..0a01a82 --- /dev/null +++ b/docs/images/connection-servo.svg @@ -0,0 +1,162 @@ + + +DO3DO2GNDDO1DO0GNDSIGPWRGNDGNDAD0GND+5V diff --git a/docs/images/connection-speaker.svg b/docs/images/connection-speaker.svg new file mode 100644 index 0000000..9b5ccbe --- /dev/null +++ b/docs/images/connection-speaker.svg @@ -0,0 +1,178 @@ + + +DO3DO2GNDDO1DO0GND-+ diff --git a/docs/images/installation-firmwareupdate.png b/docs/images/installation-firmwareupdate.png new file mode 100644 index 0000000..5008e6c Binary files /dev/null and b/docs/images/installation-firmwareupdate.png differ diff --git a/docs/images/workflowbasics-devicepattern.svg b/docs/images/workflowbasics-devicepattern.svg new file mode 100644 index 0000000..8b3adff --- /dev/null +++ b/docs/images/workflowbasics-devicepattern.svg @@ -0,0 +1,67 @@ + + +]> + + + + + + + + + + + + + + + Device Events + + + + + + Message + + + Writer + + + + + + Device + + + + + + + Device + + + Commands + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/images/workflowbasics-receiveevents.svg b/docs/images/workflowbasics-receiveevents.svg new file mode 100644 index 0000000..07caba1 --- /dev/null +++ b/docs/images/workflowbasics-receiveevents.svg @@ -0,0 +1,49 @@ + + +]> + + + + + + + + + + + + + Visualizer + + + Window + + + + + Parse + + + + + + + Device Events + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/images/workflowbasics-sendcommands.svg b/docs/images/workflowbasics-sendcommands.svg new file mode 100644 index 0000000..ed1c177 --- /dev/null +++ b/docs/images/workflowbasics-sendcommands.svg @@ -0,0 +1,55 @@ + + +]> + + + + + + + + + + + + Device + + + Commands + + + + + + Create + + + Message + + + + + + + KeyDown + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/images/workflowbasics-toplevel.svg b/docs/images/workflowbasics-toplevel.svg new file mode 100644 index 0000000..7453a42 --- /dev/null +++ b/docs/images/workflowbasics-toplevel.svg @@ -0,0 +1,195 @@ + + +]> + + + + + + + + + + + + + + + Harp Device + + + Pattern + + + + + + + + + Device Events + + + + + Send + + + Commands to + + + Device + + + + + + + Device + + + Commands + + + + + Read Events + + + from Device + + + + + + + + Visualizer + + + Window + + + + + + Message + + + Writer + + + + + + Create + + + Message + + + + + Parse + + + + + + Device + + + + + + + KeyDown + + + + + + + Device Events + + + + + + + Device + + + Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 78c0d6e..fa3b5c0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1 +1,25 @@ -[!INCLUDE [](README.md)] \ No newline at end of file +## Overview + +The Harp [Behavior](articles/behavior-overview.md) board is a multi-purpose data acquisition and control device for behavioral neuroscience experiments. + +![Harp Behavior with Peripherals](./images/behavior-peripherals.svg){width=600} + +A typical behavioral rig combines sensors, cue lights, reward valves, cameras and motorized actuators. These components usually need individual control interfaces and post-hoc alignment to a common timeline. The Behavior board brings them together on a single device, so that every input and output stream is controlled through one interface and timestamped on the same hardware clock. + +The Behavior board provides: + +- General-purpose digital inputs and outputs, plus analog inputs, for interfacing with external devices. +- Plug-in support for peripherals like the Harp Behavior [Mice Poke](articles/peripherals/peripherals-micepoke.md), [Rotary Encoder](articles/peripherals/peripherals-rotaryencoder.md), and more. +- Specialized functionality to directly control external hardware, including triggering [cameras](./articles/trigger-cameras.md), driving [servo motors](./articles/drive-servos.md), and more. +- Hardware timestamping and synchronization with other [Harp](https://harp-tech.org/articles/about.html) devices. +- [Bonsai](https://bonsai-rx.org/) integration for flexible experiment acquisition and control. + +## Getting a Device + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp), or build your own using the hardware design files in the [Behavior](https://github.com/harp-tech/device.behavior) board repository. Once you have a board, follow the "Getting Started" section to [set up the device](./articles/connections.md) and install the [software](./articles/installation.md). + +## Acknowledgments + +Hardware design and GUI contributed by [Champalimaud Foundation](https://www.cf-hw.org/), Bonsai interface by [NeuroGEARS](https://neurogears.org/), testing and feedback by [Allen Institute for Neural Dynamics](https://www.allenneuraldynamics.org/), and documentation by [Open Ephys](https://open-ephys.org/). + +[!INCLUDE [](./articles/version-footer.md)] diff --git a/docs/toc.yml b/docs/toc.yml index 3c4ae30..c615315 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -1,4 +1,4 @@ -- name: Documentation +- name: User Guide href: articles/ -- name: API +- name: Reference href: ../artifacts/docs/api/ \ No newline at end of file diff --git a/docs/workflows/acquireanalogdata-toplevel.bonsai b/docs/workflows/acquireanalogdata-toplevel.bonsai new file mode 100644 index 0000000..f873f91 --- /dev/null +++ b/docs/workflows/acquireanalogdata-toplevel.bonsai @@ -0,0 +1,91 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Analog Data + + + + Behavior Events + + + + + + + true + + 400 + 100 + + + 400 + 300 + + + + + Value.AnalogInput0,Seconds + + + + true + + 400 + 450 + + + 300 + 300 + + + + + + + + + + + + + + + diff --git a/docs/workflows/acquireanalogdata-visualizedata.bonsai b/docs/workflows/acquireanalogdata-visualizedata.bonsai new file mode 100644 index 0000000..960b966 --- /dev/null +++ b/docs/workflows/acquireanalogdata-visualizedata.bonsai @@ -0,0 +1,53 @@ + + + + + + Behavior Events + + + + + + + true + + 400 + 100 + + + 400 + 300 + + + + + Value.AnalogInput0,Seconds + + + + true + + 400 + 450 + + + 300 + 300 + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/workflows/advancedconfiguration-eventenable.bonsai b/docs/workflows/advancedconfiguration-eventenable.bonsai new file mode 100644 index 0000000..5193d08 --- /dev/null +++ b/docs/workflows/advancedconfiguration-eventenable.bonsai @@ -0,0 +1,31 @@ + + + + + + + A + false + + + + Write + + PortDI PortDIO Camera0 Camera1 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/advancedconfiguration-serialtimestamp.bonsai b/docs/workflows/advancedconfiguration-serialtimestamp.bonsai new file mode 100644 index 0000000..2c8aea5 --- /dev/null +++ b/docs/workflows/advancedconfiguration-serialtimestamp.bonsai @@ -0,0 +1,31 @@ + + + + + + + S + false + + + + Write + + TimestampPort2 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/advancedconfiguration-toplevel.bonsai b/docs/workflows/advancedconfiguration-toplevel.bonsai new file mode 100644 index 0000000..9595399 --- /dev/null +++ b/docs/workflows/advancedconfiguration-toplevel.bonsai @@ -0,0 +1,116 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Analog Data + + + + Behavior Events + + + + + + + true + + 400 + 100 + + + 400 + 300 + + + + + Select Active Events + + + + + A + false + + + + Write + + PortDI PortDIO Camera0 Camera1 + + + + Behavior Commands + + + Stream Timestamps + + + + + S + false + + + + Write + + TimestampPort2 + + + + Behavior Commands + + + + + + + + + + + + + + + diff --git a/docs/workflows/advancedconfiguration-visualizeanalog.bonsai b/docs/workflows/advancedconfiguration-visualizeanalog.bonsai new file mode 100644 index 0000000..35fa08e --- /dev/null +++ b/docs/workflows/advancedconfiguration-visualizeanalog.bonsai @@ -0,0 +1,35 @@ + + + + + + Behavior Events + + + + + + + true + + 400 + 100 + + + 400 + 300 + + + + + + + + + + diff --git a/docs/workflows/apidoc-camera0frame.bonsai b/docs/workflows/apidoc-camera0frame.bonsai new file mode 100644 index 0000000..08e709f --- /dev/null +++ b/docs/workflows/apidoc-camera0frame.bonsai @@ -0,0 +1,34 @@ + + + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + diff --git a/docs/workflows/apidoc-camera0frequency.bonsai b/docs/workflows/apidoc-camera0frequency.bonsai new file mode 100644 index 0000000..b9e3751 --- /dev/null +++ b/docs/workflows/apidoc-camera0frequency.bonsai @@ -0,0 +1,31 @@ + + + + + + + A + false + + + + Write + + 30 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/apidoc-led1current.bonsai b/docs/workflows/apidoc-led1current.bonsai new file mode 100644 index 0000000..984b09f --- /dev/null +++ b/docs/workflows/apidoc-led1current.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 20 + + + + Behavior Commands + + + Write + + 10 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-mimicport1ir.bonsai b/docs/workflows/apidoc-mimicport1ir.bonsai new file mode 100644 index 0000000..b6bcb10 --- /dev/null +++ b/docs/workflows/apidoc-mimicport1ir.bonsai @@ -0,0 +1,48 @@ + + + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + None + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-mimicport1valve.bonsai b/docs/workflows/apidoc-mimicport1valve.bonsai new file mode 100644 index 0000000..5354035 --- /dev/null +++ b/docs/workflows/apidoc-mimicport1valve.bonsai @@ -0,0 +1,65 @@ + + + + + + + D + false + + + + Write + + DO0 + + + + Behavior Commands + + + + F + false + + + + Write + + None + + + + Behavior Commands + + + + G + false + + + + Write + + SupplyPort1 + + + + Behavior Commands + + + + + + + + + + + + diff --git a/docs/workflows/apidoc-mimicport2ir.bonsai b/docs/workflows/apidoc-mimicport2ir.bonsai new file mode 100644 index 0000000..9080bac --- /dev/null +++ b/docs/workflows/apidoc-mimicport2ir.bonsai @@ -0,0 +1,48 @@ + + + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + None + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-mimicport2valve.bonsai b/docs/workflows/apidoc-mimicport2valve.bonsai new file mode 100644 index 0000000..8ae1e15 --- /dev/null +++ b/docs/workflows/apidoc-mimicport2valve.bonsai @@ -0,0 +1,65 @@ + + + + + + + D + false + + + + Write + + DO0 + + + + Behavior Commands + + + + F + false + + + + Write + + None + + + + Behavior Commands + + + + G + false + + + + Write + + SupplyPort2 + + + + Behavior Commands + + + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsedo1.bonsai b/docs/workflows/apidoc-pulsedo1.bonsai new file mode 100644 index 0000000..07f7888 --- /dev/null +++ b/docs/workflows/apidoc-pulsedo1.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DO1 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsedo2.bonsai b/docs/workflows/apidoc-pulsedo2.bonsai new file mode 100644 index 0000000..d9d4ad6 --- /dev/null +++ b/docs/workflows/apidoc-pulsedo2.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DO2 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsedo3.bonsai b/docs/workflows/apidoc-pulsedo3.bonsai new file mode 100644 index 0000000..09b616a --- /dev/null +++ b/docs/workflows/apidoc-pulsedo3.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DO3 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsedoport0.bonsai b/docs/workflows/apidoc-pulsedoport0.bonsai new file mode 100644 index 0000000..6e9ca33 --- /dev/null +++ b/docs/workflows/apidoc-pulsedoport0.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsedoport1.bonsai b/docs/workflows/apidoc-pulsedoport1.bonsai new file mode 100644 index 0000000..87773f7 --- /dev/null +++ b/docs/workflows/apidoc-pulsedoport1.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DOPort1 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsedoport2.bonsai b/docs/workflows/apidoc-pulsedoport2.bonsai new file mode 100644 index 0000000..7599121 --- /dev/null +++ b/docs/workflows/apidoc-pulsedoport2.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DOPort2 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulseled0.bonsai b/docs/workflows/apidoc-pulseled0.bonsai new file mode 100644 index 0000000..d20f83a --- /dev/null +++ b/docs/workflows/apidoc-pulseled0.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + Led0 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulseled1.bonsai b/docs/workflows/apidoc-pulseled1.bonsai new file mode 100644 index 0000000..a018bef --- /dev/null +++ b/docs/workflows/apidoc-pulseled1.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + Led1 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsergb0.bonsai b/docs/workflows/apidoc-pulsergb0.bonsai new file mode 100644 index 0000000..42e8558 --- /dev/null +++ b/docs/workflows/apidoc-pulsergb0.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + Rgb0 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsergb1.bonsai b/docs/workflows/apidoc-pulsergb1.bonsai new file mode 100644 index 0000000..aa5545e --- /dev/null +++ b/docs/workflows/apidoc-pulsergb1.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + Rgb1 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsesupplyport1.bonsai b/docs/workflows/apidoc-pulsesupplyport1.bonsai new file mode 100644 index 0000000..2c131d6 --- /dev/null +++ b/docs/workflows/apidoc-pulsesupplyport1.bonsai @@ -0,0 +1,81 @@ + + + + + + + F + false + + + + Write + + SupplyPort1 + + + + Behavior Commands + + + Write + + 15 + + + + Behavior Commands + + + Behavior Events + + + + + + + DIPort1 + + + + + + + Source1 + + + + + + + + + + Write + + SupplyPort1 + + + + Behavior Commands + + + + + + + + + + + + + + + diff --git a/docs/workflows/apidoc-pulsesupplyport2.bonsai b/docs/workflows/apidoc-pulsesupplyport2.bonsai new file mode 100644 index 0000000..45e77a6 --- /dev/null +++ b/docs/workflows/apidoc-pulsesupplyport2.bonsai @@ -0,0 +1,81 @@ + + + + + + + F + false + + + + Write + + SupplyPort2 + + + + Behavior Commands + + + Write + + 15 + + + + Behavior Commands + + + Behavior Events + + + + + + + DIPort2 + + + + + + + Source1 + + + + + + + + + + Write + + SupplyPort2 + + + + Behavior Commands + + + + + + + + + + + + + + + diff --git a/docs/workflows/apidoc-pwmdo1.bonsai b/docs/workflows/apidoc-pwmdo1.bonsai new file mode 100644 index 0000000..7c8d64d --- /dev/null +++ b/docs/workflows/apidoc-pwmdo1.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 1000 + + + + Behavior Commands + + + Write + + 50 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pwmdo2.bonsai b/docs/workflows/apidoc-pwmdo2.bonsai new file mode 100644 index 0000000..75694e7 --- /dev/null +++ b/docs/workflows/apidoc-pwmdo2.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 1000 + + + + Behavior Commands + + + Write + + 50 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-pwmdo3.bonsai b/docs/workflows/apidoc-pwmdo3.bonsai new file mode 100644 index 0000000..84a4702 --- /dev/null +++ b/docs/workflows/apidoc-pwmdo3.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 1000 + + + + Behavior Commands + + + Write + + 50 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-rgb0.bonsai b/docs/workflows/apidoc-rgb0.bonsai new file mode 100644 index 0000000..fa29d33 --- /dev/null +++ b/docs/workflows/apidoc-rgb0.bonsai @@ -0,0 +1,33 @@ + + + + + + + F + false + + + + Write + + 0 + 255 + 0 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/apidoc-rgb1.bonsai b/docs/workflows/apidoc-rgb1.bonsai new file mode 100644 index 0000000..b7f60b5 --- /dev/null +++ b/docs/workflows/apidoc-rgb1.bonsai @@ -0,0 +1,33 @@ + + + + + + + F + false + + + + Write + + 0 + 0 + 255 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/apidoc-servomotor3period.bonsai b/docs/workflows/apidoc-servomotor3period.bonsai new file mode 100644 index 0000000..e3d0401 --- /dev/null +++ b/docs/workflows/apidoc-servomotor3period.bonsai @@ -0,0 +1,48 @@ + + + + + + + A + false + + + + Write + + 20000 + + + + Behavior Commands + + + + S + false + + + + Write + + 1500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/apidoc-servomotor3pulse.bonsai b/docs/workflows/apidoc-servomotor3pulse.bonsai new file mode 100644 index 0000000..7368867 --- /dev/null +++ b/docs/workflows/apidoc-servomotor3pulse.bonsai @@ -0,0 +1,31 @@ + + + + + + + G + false + + + + Write + + 2000 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/behavior-firststeps.bonsai b/docs/workflows/behavior-firststeps.bonsai new file mode 100644 index 0000000..6c5203e --- /dev/null +++ b/docs/workflows/behavior-firststeps.bonsai @@ -0,0 +1,72 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Analog Data + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-pulse.bonsai b/docs/workflows/controldigitaloutputs-pulse.bonsai new file mode 100644 index 0000000..17a532e --- /dev/null +++ b/docs/workflows/controldigitaloutputs-pulse.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-setclear.bonsai b/docs/workflows/controldigitaloutputs-setclear.bonsai new file mode 100644 index 0000000..b4a7e6e --- /dev/null +++ b/docs/workflows/controldigitaloutputs-setclear.bonsai @@ -0,0 +1,48 @@ + + + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + DO0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-state.bonsai b/docs/workflows/controldigitaloutputs-state.bonsai new file mode 100644 index 0000000..b4b09d7 --- /dev/null +++ b/docs/workflows/controldigitaloutputs-state.bonsai @@ -0,0 +1,31 @@ + + + + + + + G + false + + + + Write + + DO0 DO1 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-timer.bonsai b/docs/workflows/controldigitaloutputs-timer.bonsai new file mode 100644 index 0000000..1756b31 --- /dev/null +++ b/docs/workflows/controldigitaloutputs-timer.bonsai @@ -0,0 +1,31 @@ + + + + + + + PT2S + PT0S + + + + Write + + DO0 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-toggle.bonsai b/docs/workflows/controldigitaloutputs-toggle.bonsai new file mode 100644 index 0000000..329f8da --- /dev/null +++ b/docs/workflows/controldigitaloutputs-toggle.bonsai @@ -0,0 +1,31 @@ + + + + + + + D + false + + + + Write + + DO0 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-toplevel.bonsai b/docs/workflows/controldigitaloutputs-toplevel.bonsai new file mode 100644 index 0000000..fbf5977 --- /dev/null +++ b/docs/workflows/controldigitaloutputs-toplevel.bonsai @@ -0,0 +1,181 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Set and Clear Outputs + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + DO0 + + + + Behavior Commands + + + Toggle Outputs + + + + + D + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write All Outputs + + + + + G + false + + + + Write + + DO0 DO1 + + + + Behavior Commands + + + Pulse Outputs + + + + + F + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + Alternative: Set Outputs with Timer + + + + + PT2S + PT0S + + + + Write + + DO0 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/controlleds-current.bonsai b/docs/workflows/controlleds-current.bonsai new file mode 100644 index 0000000..514ad58 --- /dev/null +++ b/docs/workflows/controlleds-current.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 20 + + + + Behavior Commands + + + Write + + 10 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controlleds-ledonoff.bonsai b/docs/workflows/controlleds-ledonoff.bonsai new file mode 100644 index 0000000..c9d9b5d --- /dev/null +++ b/docs/workflows/controlleds-ledonoff.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + Led0 + + + + Behavior Commands + + + + D + false + + + + Write + + Led0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controlleds-rgbcolors.bonsai b/docs/workflows/controlleds-rgbcolors.bonsai new file mode 100644 index 0000000..143d9d3 --- /dev/null +++ b/docs/workflows/controlleds-rgbcolors.bonsai @@ -0,0 +1,36 @@ + + + + + + + F + false + + + + Write + + 0 + 255 + 0 + 0 + 0 + 255 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/controlleds-rgbonoff.bonsai b/docs/workflows/controlleds-rgbonoff.bonsai new file mode 100644 index 0000000..4927c72 --- /dev/null +++ b/docs/workflows/controlleds-rgbonoff.bonsai @@ -0,0 +1,48 @@ + + + + + + + G + false + + + + Write + + Rgb0 Rgb1 + + + + Behavior Commands + + + + H + false + + + + Write + + Rgb0 Rgb1 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controlleds-toplevel.bonsai b/docs/workflows/controlleds-toplevel.bonsai new file mode 100644 index 0000000..ba62135 --- /dev/null +++ b/docs/workflows/controlleds-toplevel.bonsai @@ -0,0 +1,182 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Configure LED Current + + + + + A + false + + + + Write + + 20 + + + + Behavior Commands + + + Write + + 10 + + + + Behavior Commands + + + Turn LEDs On and Off + + + + + S + false + + + + Write + + Led0 + + + + Behavior Commands + + + + D + false + + + + Write + + Led0 + + + + Behavior Commands + + + Set RGB Colors + + + + + F + false + + + + Write + + 0 + 255 + 0 + 0 + 0 + 255 + + + + Behavior Commands + + + Turn RGB LEDs On and Off + + + + + G + false + + + + Write + + Rgb0 Rgb1 + + + + Behavior Commands + + + + H + false + + + + Write + + Rgb0 Rgb1 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/controlpoke-driveled.bonsai b/docs/workflows/controlpoke-driveled.bonsai new file mode 100644 index 0000000..3bfc0e0 --- /dev/null +++ b/docs/workflows/controlpoke-driveled.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + + D + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controlpoke-inputfilter.bonsai b/docs/workflows/controlpoke-inputfilter.bonsai new file mode 100644 index 0000000..13fea8a --- /dev/null +++ b/docs/workflows/controlpoke-inputfilter.bonsai @@ -0,0 +1,31 @@ + + + + + + + A + false + + + + Write + + 5 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/controlpoke-toplevel.bonsai b/docs/workflows/controlpoke-toplevel.bonsai new file mode 100644 index 0000000..f0aaf9c --- /dev/null +++ b/docs/workflows/controlpoke-toplevel.bonsai @@ -0,0 +1,202 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Poke Events + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + Configure Input Filter + + + + + A + false + + + + Write + + 5 + + + + Behavior Commands + + + Drive the Poke LED + + + + + S + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + + D + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + Deliver Rewards + + + + + F + false + + + + Write + + SupplyPort0 + + + + Behavior Commands + + + Write + + 15 + + + + Behavior Commands + + + Behavior Events + + + + + + + DIPort0 + + + + + + + Source1 + + + + + + + + + + Write + + SupplyPort0 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/controlpoke-valve.bonsai b/docs/workflows/controlpoke-valve.bonsai new file mode 100644 index 0000000..e2dc78d --- /dev/null +++ b/docs/workflows/controlpoke-valve.bonsai @@ -0,0 +1,81 @@ + + + + + + + F + false + + + + Write + + SupplyPort0 + + + + Behavior Commands + + + Write + + 15 + + + + Behavior Commands + + + Behavior Events + + + + + + + DIPort0 + + + + + + + Source1 + + + + + + + + + + Write + + SupplyPort0 + + + + Behavior Commands + + + + + + + + + + + + + + + diff --git a/docs/workflows/controlpoke-visualizeevents.bonsai b/docs/workflows/controlpoke-visualizeevents.bonsai new file mode 100644 index 0000000..746d0e0 --- /dev/null +++ b/docs/workflows/controlpoke-visualizeevents.bonsai @@ -0,0 +1,34 @@ + + + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + diff --git a/docs/workflows/driveservos-configure.bonsai b/docs/workflows/driveservos-configure.bonsai new file mode 100644 index 0000000..bce18fc --- /dev/null +++ b/docs/workflows/driveservos-configure.bonsai @@ -0,0 +1,48 @@ + + + + + + + A + false + + + + Write + + 20000 + + + + Behavior Commands + + + + S + false + + + + Write + + 1500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/driveservos-enabledisable.bonsai b/docs/workflows/driveservos-enabledisable.bonsai new file mode 100644 index 0000000..d369317 --- /dev/null +++ b/docs/workflows/driveservos-enabledisable.bonsai @@ -0,0 +1,48 @@ + + + + + + + D + false + + + + Write + + ServoOutput2 + + + + Behavior Commands + + + + F + false + + + + Write + + ServoOutput2 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/driveservos-position.bonsai b/docs/workflows/driveservos-position.bonsai new file mode 100644 index 0000000..e6e64fb --- /dev/null +++ b/docs/workflows/driveservos-position.bonsai @@ -0,0 +1,31 @@ + + + + + + + G + false + + + + Write + + 2000 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/driveservos-toplevel.bonsai b/docs/workflows/driveservos-toplevel.bonsai new file mode 100644 index 0000000..c5462a0 --- /dev/null +++ b/docs/workflows/driveservos-toplevel.bonsai @@ -0,0 +1,145 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Configure the Servo + + + + + A + false + + + + Write + + 20000 + + + + Behavior Commands + + + + S + false + + + + Write + + 1500 + + + + Behavior Commands + + + Enable and Disable Servos + + + + + D + false + + + + Write + + ServoOutput2 + + + + Behavior Commands + + + + F + false + + + + Write + + ServoOutput2 + + + + Behavior Commands + + + Adjust the Position + + + + + G + false + + + + Write + + 2000 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/generatepwm-configure.bonsai b/docs/workflows/generatepwm-configure.bonsai new file mode 100644 index 0000000..45efd7f --- /dev/null +++ b/docs/workflows/generatepwm-configure.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 1000 + + + + Behavior Commands + + + Write + + 50 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/generatepwm-pulseenable.bonsai b/docs/workflows/generatepwm-pulseenable.bonsai new file mode 100644 index 0000000..669f5f1 --- /dev/null +++ b/docs/workflows/generatepwm-pulseenable.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write + + 100 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/generatepwm-startstop.bonsai b/docs/workflows/generatepwm-startstop.bonsai new file mode 100644 index 0000000..13127ad --- /dev/null +++ b/docs/workflows/generatepwm-startstop.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + PwmDO0 + + + + Behavior Commands + + + + D + false + + + + Write + + PwmDO0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/generatepwm-toplevel.bonsai b/docs/workflows/generatepwm-toplevel.bonsai new file mode 100644 index 0000000..ed57a03 --- /dev/null +++ b/docs/workflows/generatepwm-toplevel.bonsai @@ -0,0 +1,150 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Configure PWM + + + + + A + false + + + + Write + + 1000 + + + + Behavior Commands + + + Write + + 50 + + + + Behavior Commands + + + Start and Stop PWM + + + + + S + false + + + + Write + + PwmDO0 + + + + Behavior Commands + + + + D + false + + + + Write + + PwmDO0 + + + + Behavior Commands + + + Generate PWM Bursts + + + + + F + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write + + 100 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/harp-devicepattern.bonsai b/docs/workflows/harp-devicepattern.bonsai new file mode 100644 index 0000000..05b4867 --- /dev/null +++ b/docs/workflows/harp-devicepattern.bonsai @@ -0,0 +1,43 @@ + + + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + + + + + + + diff --git a/docs/workflows/mimicpokesignals-mimicir.bonsai b/docs/workflows/mimicpokesignals-mimicir.bonsai new file mode 100644 index 0000000..a83f277 --- /dev/null +++ b/docs/workflows/mimicpokesignals-mimicir.bonsai @@ -0,0 +1,48 @@ + + + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + None + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/mimicpokesignals-mimicvalve.bonsai b/docs/workflows/mimicpokesignals-mimicvalve.bonsai new file mode 100644 index 0000000..9b59977 --- /dev/null +++ b/docs/workflows/mimicpokesignals-mimicvalve.bonsai @@ -0,0 +1,65 @@ + + + + + + + D + false + + + + Write + + DO0 + + + + Behavior Commands + + + + F + false + + + + Write + + None + + + + Behavior Commands + + + + G + false + + + + Write + + SupplyPort0 + + + + Behavior Commands + + + + + + + + + + + + diff --git a/docs/workflows/mimicpokesignals-toplevel.bonsai b/docs/workflows/mimicpokesignals-toplevel.bonsai new file mode 100644 index 0000000..a1dd5c0 --- /dev/null +++ b/docs/workflows/mimicpokesignals-toplevel.bonsai @@ -0,0 +1,141 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Mimic Poke Inputs + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + None + + + + Behavior Commands + + + Mimic Poke Valves + + + + + D + false + + + + Write + + DO0 + + + + Behavior Commands + + + + F + false + + + + Write + + None + + + + Behavior Commands + + + + G + false + + + + Write + + SupplyPort0 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/readdigitalinputs-toplevel.bonsai b/docs/workflows/readdigitalinputs-toplevel.bonsai new file mode 100644 index 0000000..95cc7c3 --- /dev/null +++ b/docs/workflows/readdigitalinputs-toplevel.bonsai @@ -0,0 +1,96 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Digital Input Events + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + Visualize Port DIO Events + + + + Behavior Events + + + + + + true + + 400 + 420 + + + 300 + 300 + + + + + + + + + + + + + + + diff --git a/docs/workflows/readdigitalinputs-visualizeportdio.bonsai b/docs/workflows/readdigitalinputs-visualizeportdio.bonsai new file mode 100644 index 0000000..da5b6eb --- /dev/null +++ b/docs/workflows/readdigitalinputs-visualizeportdio.bonsai @@ -0,0 +1,34 @@ + + + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + diff --git a/docs/workflows/trackrotaryencoder-enable.bonsai b/docs/workflows/trackrotaryencoder-enable.bonsai new file mode 100644 index 0000000..943c901 --- /dev/null +++ b/docs/workflows/trackrotaryencoder-enable.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + Position + + + + Behavior Commands + + + Write + + EncoderPort2 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/trackrotaryencoder-reset.bonsai b/docs/workflows/trackrotaryencoder-reset.bonsai new file mode 100644 index 0000000..4430b89 --- /dev/null +++ b/docs/workflows/trackrotaryencoder-reset.bonsai @@ -0,0 +1,31 @@ + + + + + + + S + false + + + + Write + + EncoderPort2 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/trackrotaryencoder-toplevel.bonsai b/docs/workflows/trackrotaryencoder-toplevel.bonsai new file mode 100644 index 0000000..a1ce9da --- /dev/null +++ b/docs/workflows/trackrotaryencoder-toplevel.bonsai @@ -0,0 +1,130 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Enable the Encoder + + + + + A + false + + + + Write + + Position + + + + Behavior Commands + + + Write + + EncoderPort2 + + + + Behavior Commands + + + Visualize Encoder Reading + + + + Behavior Events + + + + + + Encoder + + + true + + 400 + 100 + + + 300 + 300 + + + + + Reset the Encoder + + + + + S + false + + + + Write + + EncoderPort2 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/trackrotaryencoder-visualize.bonsai b/docs/workflows/trackrotaryencoder-visualize.bonsai new file mode 100644 index 0000000..521db20 --- /dev/null +++ b/docs/workflows/trackrotaryencoder-visualize.bonsai @@ -0,0 +1,38 @@ + + + + + + Behavior Events + + + + + + Encoder + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + + diff --git a/docs/workflows/triggercameras-frequency.bonsai b/docs/workflows/triggercameras-frequency.bonsai new file mode 100644 index 0000000..5f17452 --- /dev/null +++ b/docs/workflows/triggercameras-frequency.bonsai @@ -0,0 +1,31 @@ + + + + + + + A + false + + + + Write + + 30 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/triggercameras-startstop.bonsai b/docs/workflows/triggercameras-startstop.bonsai new file mode 100644 index 0000000..8877989 --- /dev/null +++ b/docs/workflows/triggercameras-startstop.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + CameraOutput1 + + + + Behavior Commands + + + + D + false + + + + Write + + CameraOutput1 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/triggercameras-toplevel.bonsai b/docs/workflows/triggercameras-toplevel.bonsai new file mode 100644 index 0000000..79f899c --- /dev/null +++ b/docs/workflows/triggercameras-toplevel.bonsai @@ -0,0 +1,132 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Configure Trigger Frequency + + + + + A + false + + + + Write + + 30 + + + + Behavior Commands + + + Start and Stop Cameras + + + + + S + false + + + + Write + + CameraOutput1 + + + + Behavior Commands + + + + D + false + + + + Write + + CameraOutput1 + + + + Behavior Commands + + + Visualize Frame Events + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/triggercameras-visualizeframes.bonsai b/docs/workflows/triggercameras-visualizeframes.bonsai new file mode 100644 index 0000000..5a69246 --- /dev/null +++ b/docs/workflows/triggercameras-visualizeframes.bonsai @@ -0,0 +1,34 @@ + + + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + +