diff --git a/server/plugins/BELAUGens.cpp b/server/plugins/BELAUGens.cpp index 4f38c0de215..de8c902b702 100644 --- a/server/plugins/BELAUGens.cpp +++ b/server/plugins/BELAUGens.cpp @@ -690,6 +690,9 @@ void DigitalOut_Ctor(DigitalOut *unit) int writeMode = (int) ZIN0(2); // method of writing; 1 = writeOnce; 0 = write on change -- cannot change after construction unit->mDigitalPin = (int) fDigital; unit->mLastOut = 0; + // initialize first buffer + pinMode(context, 0, unit->mDigitalPin, OUTPUT); + digitalWrite(context, 0, unit->mDigitalPin, unit->mLastOut); if ( (unit->mDigitalPin < 0) || (unit->mDigitalPin >= context->digitalChannels) ){ rt_printf( "DigitalOut warning: digital pin must be between %i and %i, it is %i \n", 0, context->digitalChannels, unit->mDigitalPin );