Cue control with serial- syntax conflict

General topics regarding SCS
Post Reply
cblackley
Posts: 16
Joined: Tue Dec 16, 2014 9:02 am

Cue control with serial- syntax conflict

Post by cblackley » Tue Oct 04, 2016 5:02 am

I am trying to use an Arduino to send serial commands into SCS, to trigger a cue sequence.
The problem is that the serial string required " scsGo("x") " , when written into the Arduino code, can't compile , because the double apostrophe and brackets get read as program code, not as part of the serial string to be sent.
Otherwise serial is working - " scsGotop" works fine.

Any suggestions for a work around ? either in SCS, or in Arduino ?

Thanks
Craig Blackley
Fanshawe College, London, Ontario, Canada

Mike Daniell
Site Admin
Posts: 3630
Joined: Sun Jul 24, 2005 8:58 am
Location: Brisbane, Queensland, Australia. TZ:GMT+10
Contact:

Re: Cue control with serial- syntax conflict

Post by Mike Daniell » Tue Oct 04, 2016 4:10 pm

Does the Arduino have any alternatives to serial?

For network connections SCS now supports OSC commands - see Cue Control Devices - Network. Unfortunately, OSC is not a text-based protocol as it includes binary and floating point fields. However, I have partially implemented what I've termed a text-based OSC to make this easier to use with devices that do not natively support OSC. I could extend this to RS232 (serial) cue control in a future release of SCS.
Mike Daniell
Show Cue Systems Pty Ltd
mike@showcuesystems.com
Image

Buyaicia
Posts: 171
Joined: Sat Aug 03, 2013 2:36 am
Location: Barcelona, Catalunya
Contact:

Re: Cue control with serial- syntax conflict

Post by Buyaicia » Tue Oct 04, 2016 4:31 pm

Hi cblackley,

I do not know which is the sintax of Arduino programing language, but in other languages you can fill a string variable with scsGo("x") doing something like this:
WorkStringr= "scsGo("+chr(34)+"x"+chr(34)+")"

Hope this helps,
Regards,
Lluís

cblackley
Posts: 16
Joined: Tue Dec 16, 2014 9:02 am

Re: Cue control with serial- syntax conflict

Post by cblackley » Tue Oct 04, 2016 11:42 pm

I got it working- thanks for the help. I didn't use your method, but it helped me find what I needed.

For future reference : in the Arduino sketch I have a declaration : char Str1[11] = {'s', 'c', 's', 'G', 'o', '(', '"', 'Q', '1', '"', ')'};
Note the "11" sets the number of characters- this may change depending on your Cue number
This creates a string, made of individual characters

Then in the loop part of the code : Serial.println(Str1);
This "prints" that string to the serial port, and adds a line return at the end ( as required by SCS )

Note 1 : SCS gets very unhappy when it is running, and you have Cue Control setup on the serial port, and then you use the Arduino editor to upload to the Arduino. So if you are tweaking your Arduino code, exit SCS, upload to Arduino, then restart SCS

Note 2 : someone has created an Arduino Library ( an extension to the basic code to add functions ) to support OSC, so some interesting possibilities await

Note 3 : the point of this project was to have a simple remote GO button to start SCS running a sequence of cues. We are using numeric keypads in some instances, but USB cabling length is pretty limited, even with various extension methods.

Craig Blackley

BritGeek
Posts: 43
Joined: Tue Dec 16, 2014 9:13 am

Re: Cue control with serial- syntax conflict

Post by BritGeek » Thu Oct 06, 2016 11:36 am

Your code snippets look like C or C++ syntax, so hopefully it supports the backslash character to mark a special character in a string.

If so, you should be able to do something like this instead of having to list all the individual characters - just insert a backslash before each double-quote that you want to appear within the string:

Serial.println("scsGo(\"Q1\")");

If it follows C/C++ syntax, the brackets within the string should not cause a problem, only the double-quotes would need the backslashes.

Tim.

Post Reply