Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 2:7ca124b4dbcb, committed 2019-07-22
- Comitter:
- yusaku0125
- Date:
- Mon Jul 22 10:28:52 2019 +0000
- Parent:
- 1:b71b5722e3a1
- Child:
- 3:2c44ef989724
- Commit message:
- test
Changed in this revision
| TB6612FNG.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/TB6612FNG.lib Mon Jul 22 09:48:09 2019 +0000 +++ b/TB6612FNG.lib Mon Jul 22 10:28:52 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/jksoft/code/TB6612FNG/#95d5e9ee8c15 +https://os.mbed.com/teams/Robotrace_shimane/code/TB6612FNG/#80ac3e662fe4
--- a/main.cpp Mon Jul 22 09:48:09 2019 +0000
+++ b/main.cpp Mon Jul 22 10:28:52 2019 +0000
@@ -3,7 +3,6 @@
//生成時のピン割当はマイコンピン割当通りに配置すること。
#include "mbed.h"
#include "TB6612.h"
-AnalogIn ain(A0); //モータ速度制御用アナログピン
TB6612 motor_a(D2,D7,D6); //モータA制御用(pwma,ain1,ain2)
TB6612 motor_b(D10,D8,D9); //モータB制御用(pwmb,bin1,bin2)
Serial pc(USBTX,USBRX); //USBシリアル通信用
@@ -13,7 +12,7 @@
char input_data; //キーボード入力情報格納用
while(1) {
input_data=pc.getc(); //キーボード入力情報取得
- motor_speed=ain.read()/2; //モータスピード情報取得(低速運転させるため2分の1の値とする。)
+ motor_speed=0.5; //モータスピード(低速運転させるため2分の1の値とする。)
switch(input_data){
case '1': motor_a=motor_speed; //モータA正転
break;