Skip to content

Commit

Permalink
ドキュメント修正
Browse files Browse the repository at this point in the history
  • Loading branch information
eyr1n committed Oct 29, 2024
1 parent a4091da commit 8c55143
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
13 changes: 9 additions & 4 deletions include/tutrc_harurobo_lib/c610.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,26 @@ namespace tutrc_harurobo_lib {
*
* extern CAN_HandleTypeDef hcan1;
*
* using namespace tutrc_harurobo_lib;
*
* CAN can1;
* C610 c610;
*
* void example_thread(void *) {
* tutrc_harurobo_lib::CAN can1(&hcan1);
* tutrc_harurobo_lib::C610 c610(&can1);
* can1.init(&hcan1);
* c610.init(&can1);
*
* while (true) {
* c610.update(); // データ送受信
*
* float Kp = 100;
* float v_target = 100.0f;
* // 現在の速度をrpsで取得
* float v_actual = c610.get_rps(tutrc_harurobo_lib::C610::ID::ID1);
* float v_actual = c610.get_rps(C610::ID::ID1);
* float error = v_target - v_actual;
*
* // 電流値をmAで指定
* c610.set_current(tutrc_harurobo_lib::C610::ID::ID1, Kp * error);
* c610.set_current(C610::ID::ID1, Kp * error);
*
* osDelay(10);
* }
Expand Down
9 changes: 7 additions & 2 deletions include/tutrc_harurobo_lib/uart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ namespace tutrc_harurobo_lib {
* extern UART_HandleTypeDef huart1;
* extern UART_HandleTypeDef huart2;
*
* using namespace tutrc_harurobo_lib;
*
* UART uart1;
* UART uart2;
*
* void example_thread(void *) {
* tutrc_harurobo_lib::UART uart1(&huart1);
* tutrc_harurobo_lib::UART uart2(&huart2);
* uart1.init(&huart1);
* uart2.init(&huart2);
*
* uart2.enable_printf(); // UART2に対してprintf有効化
*
Expand Down

0 comments on commit 8c55143

Please sign in to comment.