Keywish Hummer-Bot-2.0 Instruction Manual page 97

Table of Contents

Advertisement

#include "Hummerbot.h"
#include "ProtocolParser.h"
#include "KeyMap.h"
#include "debug.h"
#define INPUT2_PIN 10
#define INPUT1_PIN 6
#define INPUT4_PIN 5
#define INPUT3_PIN 9
ProtocolParser *mProtocol
Hummerbot
hbot(mProtocol, INPUT2_PIN, INPUT1_PIN, INPUT3_PIN, INPUT4_PIN);
void
setup()
{
Serial.begin(9600);
hbot.init();
hbot.SetControlMode(E_BLUETOOTH_CONTROL);
hbot.SetSpeed(0);
}
//========================= bluetooth
void
HandleBluetoothRemote()
{
if
(mProtocol->ParserPackage())
{
switch(mProtocol->GetRobotControlFun())
{
case
E_INFO:
break;
case
E_ROBOT_CONTROL_DIRECTION:
hbot.Drive(mProtocol->GetRobotDegree());
break;
case
E_ROBOT_CONTROL_SPEED:
hbot.SetSpeed(mProtocol->GetRobotSpeed());
break
case
E_CONTROL_MODE:
hbot.SetControlMode(mProtocol->GetControlMode());
break;
case
E_VERSION:
break;
}
}
}
// PWMB
// DIRB --- right
// PWMA
// DIRA --- left
=
new
ProtocolParser();
;
94

Advertisement

Table of Contents
loading

Related Products for Keywish Hummer-Bot-2.0

Table of Contents