Utilities classes for the Zumo Robot

Dependents:   ZumoRobotBluetoothControlled Fsl_Zumo

This library represents some useful code for controlling your Zumo Robot.

Committer:
catalincraciun7
Date:
Sun Nov 02 11:35:00 2014 +0000
Revision:
2:036da44b023e
Parent:
0:8ebbd2bd34f5
Child:
3:b1fde0759c94
Bluetooth connection is done. VelocityX and VelocityY communication.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
catalincraciun7 0:8ebbd2bd34f5 1 // Craciun Catalin
catalincraciun7 0:8ebbd2bd34f5 2 // ZumoRobotManager.cpp
catalincraciun7 0:8ebbd2bd34f5 3 // © 2014 Catalin Craciun
catalincraciun7 0:8ebbd2bd34f5 4
catalincraciun7 0:8ebbd2bd34f5 5 #ifndef ZumoRobotManagerCpp
catalincraciun7 0:8ebbd2bd34f5 6 #define ZumoRobotManagerCpp
catalincraciun7 0:8ebbd2bd34f5 7
catalincraciun7 0:8ebbd2bd34f5 8 #include "ZumoRobotManager.h"
catalincraciun7 2:036da44b023e 9 #include "mbed.h"
catalincraciun7 2:036da44b023e 10
catalincraciun7 2:036da44b023e 11 Serial pc (USBTX, USBRX);
catalincraciun7 0:8ebbd2bd34f5 12
catalincraciun7 0:8ebbd2bd34f5 13 ZumoRobotManager::ZumoRobotManager() {
catalincraciun7 0:8ebbd2bd34f5 14
catalincraciun7 0:8ebbd2bd34f5 15 // Initialising
catalincraciun7 2:036da44b023e 16 this -> velocityX = 0;
catalincraciun7 2:036da44b023e 17 this -> velocityY = 0;
catalincraciun7 0:8ebbd2bd34f5 18 }
catalincraciun7 0:8ebbd2bd34f5 19
catalincraciun7 0:8ebbd2bd34f5 20 ZumoRobotManager::~ZumoRobotManager() {
catalincraciun7 0:8ebbd2bd34f5 21
catalincraciun7 0:8ebbd2bd34f5 22 // Deinitialising
catalincraciun7 0:8ebbd2bd34f5 23
catalincraciun7 0:8ebbd2bd34f5 24 }
catalincraciun7 0:8ebbd2bd34f5 25
catalincraciun7 2:036da44b023e 26 float ZumoRobotManager::getVelocityX() {
catalincraciun7 2:036da44b023e 27
catalincraciun7 2:036da44b023e 28 return this -> velocityX;
catalincraciun7 2:036da44b023e 29 }
catalincraciun7 2:036da44b023e 30
catalincraciun7 2:036da44b023e 31 float ZumoRobotManager::getVelocityY() {
catalincraciun7 2:036da44b023e 32
catalincraciun7 2:036da44b023e 33 return this -> velocityY;
catalincraciun7 2:036da44b023e 34 }
catalincraciun7 2:036da44b023e 35
catalincraciun7 2:036da44b023e 36 void ZumoRobotManager::setVelocityX(float newValue) {
catalincraciun7 2:036da44b023e 37
catalincraciun7 2:036da44b023e 38 this -> velocityX = newValue;
catalincraciun7 2:036da44b023e 39 }
catalincraciun7 2:036da44b023e 40
catalincraciun7 2:036da44b023e 41 void ZumoRobotManager::setVelocityY(float newValue) {
catalincraciun7 2:036da44b023e 42
catalincraciun7 2:036da44b023e 43 this -> velocityY = newValue;
catalincraciun7 2:036da44b023e 44 }
catalincraciun7 2:036da44b023e 45
catalincraciun7 0:8ebbd2bd34f5 46 #endif // ZumoRobotManagerCpp