lib-of-vs-libs-openFrameworks-communication-ofArduino.h / h
This class extend ofStandardFirmata and provides additional functionality like servo support through SysEx messages. use the OFstdFirmata for servo support...**/ class ofArduino: public ofStandardFirmata{ public: ofArduino(); virtual ~ofArduino(); int connect(string device, int baud=57600); // opens a serial port connection to the arduino // Note: GlueFirmata is set to use 57600 bps by default since 115200 (the firmata default) has proven to be unreliable bool isArduinoReady(); void setUseDelay(bool bDelay); // -- servo void sendServo(int pin, int value, bool force=false); // pin: 9, 10 // the pin has to have a servo attached void sendServoAttach(int pin, int minPulse=544, int maxPulse=2400, int angle=180); // pin: 9, 10 // attaches a servo to a pin void sendServoDetach(int pin); // pin: 9, 10 // detaches a servo from a pin, the pin mode remains as OUTPUT int getServo(int pin); // returns the last set servo value for a pin if the pin has a servo attached protected: bool bUseDelay; bool connected; float connectTime; void processSysExData(vector<unsigned char> data); int _servoValue[ARD_TOTAL_DIGITAL_PINS]; // the last set servo values float _temp; // the last received temperature float _humidity; // the last received humidity }; endif
[]readme course(s) prefaceI 1 2II 3 4III 5 6 7IV 8 9 10V 11 12 afterthought(s)appendix reference(s) example(s)resource(s) _![]()
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.