mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Fixed robot libraries and examples for unified Arduino core
This commit is contained in:
@ -230,16 +230,20 @@ void RobotMotorBoard::_analogRead(uint8_t codename){
|
||||
messageOut.sendData();
|
||||
}
|
||||
int RobotMotorBoard::IRread(uint8_t num){
|
||||
IRs.selectPin(num-1); //To make consistant with the pins labeled on the board
|
||||
return _IRread(num-1); //To make consistant with the pins labeled on the board
|
||||
}
|
||||
|
||||
int RobotMotorBoard::_IRread(uint8_t num){
|
||||
IRs.selectPin(num);
|
||||
return IRs.getAnalogValue();
|
||||
}
|
||||
|
||||
|
||||
void RobotMotorBoard::_readIR(){
|
||||
//Serial.println("readIR");
|
||||
int value;
|
||||
messageOut.writeByte(COMMAND_READ_IR_RE);
|
||||
for(int i=1;i<6;i++){
|
||||
value=IRread(i);
|
||||
for(int i=0;i<5;i++){
|
||||
value=_IRread(i);
|
||||
messageOut.writeInt(value);
|
||||
}
|
||||
messageOut.sendData();
|
||||
|
Reference in New Issue
Block a user