![]() |
Custom Classes?
How would I go about creating a custom class? For example, I want a class that has a digitalInput encapsulated within it. In simple terms, How would I convert my existing LimitSwitch class (https://github.com/itguy51/FRC4014-2...mitSwitch.java) into C++? I have never actually used C++ in Object-Oriented programming other than simple things like in Visual Studio for demonstrations. I guessed how, and got this:
Code:
class limitSwitchgetState is supposed to return true/false based on the state of the switch. |
Re: Custom Classes?
Two ways of doing it. One is totally inline as you're doing it (which isn't really the C++ way of doing it).
Code:
#include <wpilib.h>Code:
#ifndef __LIMITSWITCH_HCode:
#include <wpilib.h> |
| All times are GMT -5. The time now is 18:18. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi