コメント
This commit is contained in:
parent
8dbdddaaea
commit
a9ba272657
1 changed files with 6 additions and 6 deletions
|
@ -159,9 +159,9 @@ int checkMarker(byte sensor){
|
|||
return mode;
|
||||
}
|
||||
|
||||
void motorMode(byte motorLeftMode, byte motorRightMode, byte motorLeftSpeed, byte motorRightSpeed){
|
||||
motorL.mode( motorLeftMode, motorLeftSpeed);
|
||||
motorR.mode(motorRightMode, motorRightSpeed);
|
||||
void motorMode(byte leftMode, byte rightMode, byte leftSpeed, byte rightSpeed){
|
||||
motorL.mode( leftMode, leftSpeed);
|
||||
motorR.mode(rightMode, rightSpeed);
|
||||
}
|
||||
|
||||
void handle(int degree){
|
||||
|
@ -197,7 +197,7 @@ void sensorInit(){
|
|||
}
|
||||
|
||||
byte sensorRead(){
|
||||
byte sensor = 0;
|
||||
byte sensor = 0; //黒が1、白が0
|
||||
if(digitalRead(PIN_SENSOR_0)) sensor += 0b00000001;
|
||||
if(digitalRead(PIN_SENSOR_1)) sensor += 0b00000010;
|
||||
if(digitalRead(PIN_SENSOR_2)) sensor += 0b00000100;
|
||||
|
@ -239,10 +239,10 @@ void setup() {
|
|||
|
||||
void loop(){
|
||||
/* センサーを見る */
|
||||
byte sensor = 0;
|
||||
byte sensor = 0; //ラインが1、地面が0
|
||||
#ifdef LINE_BLACK //黒ライン
|
||||
sensor = sensorRead();
|
||||
#else
|
||||
#else //白ライン
|
||||
sensor = ~sensorRead();
|
||||
#endif
|
||||
count(); //ロータリーエンコーダーの変化を見る
|
||||
|
|
Loading…
Add table
Reference in a new issue