Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pwmFrequency and setPowerMode examples #223

Merged
merged 3 commits into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/src/components/board/board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract class Board extends Resource {
///
/// ```
/// // Get the PWM frequency of pin 11
/// var frequency = await myBoard.get('11');
/// var frequency = await myBoard.pwmFrequency('11');
/// ```
Future<int> pwmFrequency(String pin, {Map<String, dynamic>? extra});

Expand Down Expand Up @@ -87,9 +87,10 @@ abstract class Board extends Resource {
/// ```
Stream<Tick> streamTicks(List<String> interrupts, {Map<String, dynamic>? extra});

/// addCallbacks adds a listener for the digital interrupts.
/// Add a listener for the digital interrupts.
///
/// ```
/// // Add a listener for digital interrupts on pins 8 and 11
/// var interrupts = ['8', '11'];
/// final tickQueue = Queue<Tick>();
/// await myBoard.addCallbacks(interrupts, tickQueue);
Expand All @@ -100,7 +101,9 @@ abstract class Board extends Resource {
///
/// ```
/// // Set the power mode of the board to offline deep for 60 seconds
/// await myBoard.setPowerMode(POWER_MODE_OFFLINE_DEEP, 60, 0);
/// // Requires importing 'package:viam_sdk/protos/component/board.dart'
/// const powerMode = PowerMode.POWER_MODE_OFFLINE_DEEP;
/// await myBoard.setPowerMode(powerMode, 60, 0);
/// ```
Future<void> setPowerMode(PowerMode powerMode, int seconds, int nanos, {Map<String, dynamic>? extra});

Expand Down