source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/libraries/Robot_Control/src/communication.cpp @ 46

Last change on this file since 46 was 46, checked in by jrpelegrina, 4 years ago

First release to Xenial

File size: 695 bytes
Line 
1#include <ArduinoRobot.h>
2
3bool RobotControl::isActionDone(){
4        if(messageIn.receiveData()){
5                if(messageIn.readByte()==COMMAND_ACTION_DONE){
6                        return true;
7                }
8        }
9        return false;
10}
11
12void RobotControl::pauseMode(uint8_t onOff){
13        messageOut.writeByte(COMMAND_PAUSE_MODE);
14        if(onOff){
15                messageOut.writeByte(true);
16        }else{
17                messageOut.writeByte(false);
18        }
19        messageOut.sendData();
20}
21
22void RobotControl::lineFollowConfig(uint8_t KP, uint8_t KD, uint8_t robotSpeed, uint8_t intergrationTime){
23        messageOut.writeByte(COMMAND_LINE_FOLLOW_CONFIG);
24        messageOut.writeByte(KP);
25        messageOut.writeByte(KD);
26        messageOut.writeByte(robotSpeed);
27        messageOut.writeByte(intergrationTime);
28        messageOut.sendData();
29}
Note: See TracBrowser for help on using the repository browser.