Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

Arduino / of0.9.0 / of0.8.4

$
0
0

I'm running 2.4.4 - the version that comes with Arduino 1.6.6

Just to make sure I've got your latest code: I've merged this commit

Awesome.
The servo is at pin 9, the PWM pin (with a LED) is pin 11
My setup function (called via the arduino.EInitialized event) looks like this:

void ofApp::setupArduino(const int & version) {
    ofRemoveListener(arduino.EInitialized, this, &ofApp::setupArduino);

    ofLogNotice() << arduino.getFirmwareName();
    ofLogNotice() << " v" << arduino.getMajorFirmwareVersion() << "." << arduino.getMinorFirmwareVersion();

    arduino.sendAnalogPinReporting(0, ARD_ANALOG);
    arduino.sendDigitalPinMode(2, ARD_INPUT);
    arduino.sendDigitalPinMode(13, ARD_OUTPUT);
    arduino.sendDigitalPinMode(11, ARD_PWM);
    arduino.sendServoAttach(9);

    // Listen for changes on the digital and analog pins
    ofAddListener(arduino.EDigitalPinChanged, this, &ofApp::digitalPinChanged);
    ofAddListener(arduino.EAnalogPinChanged, this, &ofApp::analogPinChanged);

}

Oh, not sure if it is relevant: after the arduino.connect(...) I have an explicit call to sendFirmareVersionRequest() like you suggested elsewhere.


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>