gaDigitalWrite(int,int)

Syntax

gaDigitalWrite(int,int)

Example

pwmPin = 10
outputValue = 0

function update()
    // control 0-255 pwm range with mouse x
    outputValue = math.floor((gaMouseX()/OUTPUT_W)*255)
    gaDigitalWrite(pwmPin,outputvalue)
end

function draw()
    gaBackground(0.0,1.0)
    
    ofSetColor(outputValue)
    ofCircle(OUTPUT_W/2,OUTPUT_H/2,200)
end

Description

This write the specified value into the specified arduino digital pin, either the normal ones like the PWM ones. When sending values to a digital pin, use 0 or 1 values; for PWM pins use the 0-255 range. Do not forget to previously set the arduino pins in the GAmuza Arduino module, available in main menu, Modules/Arduino. Example: if you're using digital pin 10 as PWM, go to the panel and set digital pin 10 to pwm.

Parameters

int,int