Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Arduino: 1.6.3 (Mac OS X), Board: "Arduino Uno"
- /Arduino/libraries/libraries/VEX_Robot_Control/VEX_Robot_Control.cpp:11:6: error: prototype for 'void RobotVEXMotor::SetPower(float)' does not match any in class 'RobotVEXMotor'
- void RobotVEXMotor::SetPower(float power)
- ^
- In file included from /Arduino/libraries/libraries/VEX_Robot_Control/VEX_Robot_Control.cpp:2:0:
- /Users/pawlak/Documents/Arduino/libraries/VEX_Robot_Control/VEX_Robot_Control.h:10:8: error: candidate is: void RobotVEXMotor::SetPower(int)
- void SetPower(int power);
- ^
- /Arduino/libraries/libraries/VEX_Robot_Control/VEX_Robot_Control.cpp:16:38: error: no 'void RobotVEXMotor::SetInvert(bool)' member function declared in class 'RobotVEXMotor'
- void RobotVEXMotor::SetInvert(bool yn) //since motors are mirror to each other
- ^
- Error compiling.
- #include "Arduino.h"
- #include <VEX_Robot_Control.h>
- RobotVEXMotor::RobotVEXMotor(int pin) {
- m_pin = pin;
- }
- void RobotVEXMotor::SetPower(int power) {
- analogWrite(m_pin, map(map(power, -100, 100, -80, 80), -100, 100, 0, 255)));
- }
- void RobotVEXMotor::SetAngle(int angle) {
- analogWrite(m_pin, map(map(angle, -100, 100, 60, 120), 60, 120, 0, 255));
- }
- #ifndef VEX_Robot_Control_h
- #define VEX_Robot_Control_h
- #include "Arduino.h"
- class RobotVEXMotor {
- public:
- RobotVEXMotor(int pin);
- void SetPower(int power);
- void SetAngle(int angle);
- private:
- int m_pin;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement