Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Turn of LEDs on Arduino

$
0
0

@panvari wrote:

I am creating a game using openframeworks and arduino that involves the player “eating” fruit, where when the player moves over the fruit it disappears. When this happens I also have an arduino LED turn on. However, it does not turn off after the fruit disappears and remains on.

if (strawberryDistance < 75 ) {
	strawberryPos = ofVec2f(-100, 10000);
	score = score + 100;

	arduino.sendDigital(13, ARD_HIGH);
}

I have tried

else if (strawberryDistance > 75) {
	arduino.sendDigital(13, ARD_LOW);
}

and

else {
	arduino.sendDigital(13, ARD_LOW);
}

but both of these give me an error once the project runs.

Please let me know if there is any other way I can get the lights to turn off.

Thank you!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles