![]() |
An error when inheriting Joystick
There are cases in our code when we use the negated value of the Y-axis for a Joystick. I know this is (really) easy to do, but for convenience, I'd love to extend the Joystick class to include a member function that would do it automatically—I think the resultant code would read a little more intuitively.
So I tried writing this: Code:
#include "WPILib.h"Quote:
I understand that this issue on its own is an unimportant one. But I'm doing something wrong, and I'd like to know why. Besides, knowing more about C++ and WPILib can't hurt me. Edit: I found a WPILib-extending library that includes an extended Joystick class. After looking there, I tried rewriting the class as follows, and built without error: Code:
class MyNewAndImprovedJoystickClass : public Joystick |
| All times are GMT -5. The time now is 12:57. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi