Skip to content

Commit

Permalink
DOCS-2949: QA board examples (#4661)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessamyT authored Jan 7, 2025
1 parent cff8905 commit 429384d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/board/board.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ type Board interface {
// analog, err := myBoard.AnalogByName("my_example_analog")
//
// // Set the pin to value 48.
// err := analog.Write(context.Background(), 48, nil)
// err = analog.Write(context.Background(), 48, nil)
type Analog interface {
// Read reads off the current value.
Read(ctx context.Context, extra map[string]interface{}) (AnalogValue, error)
Expand Down
10 changes: 5 additions & 5 deletions components/board/gpio_pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// pin, err := myBoard.GPIOPinByName("15")
//
// // Set the pin to high.
// err := pin.Set(context.Background(), "true", nil)
// err = pin.Set(context.Background(), true, nil)
//
// Get example:
//
Expand All @@ -27,7 +27,7 @@ import (
// pin, err := myBoard.GPIOPinByName("15")
//
// // Get if it is true or false that the state of the pin is high.
// high := pin.Get(context.Background(), nil)
// high, err := pin.Get(context.Background(), nil)
//
// PWM example:
//
Expand All @@ -37,7 +37,7 @@ import (
// pin, err := myBoard.GPIOPinByName("15")
//
// // Returns the duty cycle.
// duty_cycle := pin.PWM(context.Background(), nil)
// duty_cycle, err := pin.PWM(context.Background(), nil)
//
// SetPWM example:
//
Expand All @@ -47,7 +47,7 @@ import (
// pin, err := myBoard.GPIOPinByName("15")
//
// // Set the duty cycle to .6, meaning that this pin will be in the high state for 60% of the duration of the PWM interval period.
// err := pin.SetPWM(context.Background(), .6, nil)
// err = pin.SetPWM(context.Background(), .6, nil)
//
// PWMFreq example:
//
Expand All @@ -67,7 +67,7 @@ import (
// pin, err := myBoard.GPIOPinByName("15")
//
// // Set the PWM frequency of this pin to 1600 Hz.
// high := pin.SetPWMFreq(context.Background(), 1600, nil)
// err = pin.SetPWMFreq(context.Background(), 1600, nil)
type GPIOPin interface {
// Set sets the pin to either low or high.
Set(ctx context.Context, high bool, extra map[string]interface{}) error
Expand Down

0 comments on commit 429384d

Please sign in to comment.