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

ofSerial works for a few seconds then stops

$
0
0

@aaa wrote:

I’m testing out sending some basic serial data from oF -> Arduino and running into some problems. It works for a couple cycles and then stops:

unsigned char myByte = 0;
mySerial.writeByte(myByte);

ofSleepMillis(1000);

myByte = 90;
mySerial.writeByte(myByte);

ofSleepMillis(1000);

myByte = 180;
mySerial.writeByte(myByte);

ofSleepMillis(1000);

myByte = 90;
mySerial.writeByte(myByte);

ofSleepMillis(1000);

ofLog() << "hi";

The Arduino is simply reading these incoming bytes and actuating a servo motor to that position. It works just fine in Processing, which leads me to believe this is a problem with oF or the Raspberry Pi it’s running on. I remember seeing a post for creating long term installations that strongly suggested using MIDI instead of USB Serial comms, perhaps for this exact reason?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles