-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read values from VESC motor controller
Change-Id: Icaad5bd270827f1fa1b22a77d0cd0e23dbf999e5
- Loading branch information
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
#include "third_party/vesc_uart/VescUart.h" | ||
//#include "" | ||
|
||
#include <cstdint> | ||
#include <fmt/core.h> | ||
|
||
auto main() -> int | ||
{ | ||
::VescUartSetCurrent(1.0F); | ||
|
||
auto cmd_get_values = std::uint8_t{ COMM_GET_VALUES }; | ||
constexpr auto serial_device = 0; | ||
::PackSendPayload(&cmd_get_values, sizeof(cmd_get_values), serial_device); | ||
|
||
const auto len_payload = Serial.read(); | ||
fmt::print("len payload: {}\n", len_payload); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Fake API for UART read/write. | ||
// API for UART read/write. | ||
|
||
#pragma once | ||
|
||
|