Welcome Guest! To enable all features please Login or Register.
Options
Go to last post Go to first unread
mark.chambers@velocino.com.au  
#1 Posted : Saturday, July 25, 2015 9:36:23 AM(UTC)
mark.chambers@velocino.com.au

Rank: Member

Groups: Registered
Joined: 7/25/2015(UTC)
Posts: 17

Is it possible to use, for example, Serial.print() in a custom node?
EmbrioAdmin  
#2 Posted : Saturday, July 25, 2015 5:59:04 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 81 time(s) in 76 post(s)
Yes you can. You might have an issue in connected mode though because while you are using Embrio the computer is communicating with the Arduino using serial.print. Your Serial.Prints might interfere with that communication, but it might not. Anyway it doesn't really make sense to use them in design mode because you can just see the data in the UI, but they do work fine in a compiled program.
mark.chambers@velocino.com.au  
#3 Posted : Sunday, July 26, 2015 6:05:20 AM(UTC)
mark.chambers@velocino.com.au

Rank: Member

Groups: Registered
Joined: 7/25/2015(UTC)
Posts: 17

That makes sense but how can the the code tell if it's in design/connected mode or compiled?
EmbrioAdmin  
#4 Posted : Sunday, July 26, 2015 6:41:03 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 81 time(s) in 76 post(s)
On the bottom left of the screen is a serial connection control. When the plug icon is "connected" and the status is "good connection", that means you are communicating with an Arduino, and Embrio should be updating with live data. Use the little icon that looks like a microchip to upload a final program (this is only possible with a full license), and the program is uploaded to run entirely on the Arduino. This tutorial video might help.
mark.chambers@velocino.com.au  
#5 Posted : Tuesday, July 28, 2015 10:34:04 AM(UTC)
mark.chambers@velocino.com.au

Rank: Member

Groups: Registered
Joined: 7/25/2015(UTC)
Posts: 17

No, I meant 'how does the arduino code know that it's connected.

eg.

if (!connected())
Serial.println("This won't mess with the Embrio comms');

How do I implement 'connected()'?

Regards,
Mark

EmbrioAdmin  
#6 Posted : Tuesday, July 28, 2015 10:37:44 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 81 time(s) in 76 post(s)
That's a good idea! There's nothing like that yet. I guess for now you'll have put a flag in your custom arduino nodes and make sure to set the value correctly. I like the idea of a global flag so your arduino code knows if it is compiled mode. I'll add that to the list.
mark.chambers@velocino.com.au  
#7 Posted : Wednesday, August 05, 2015 4:16:05 AM(UTC)
mark.chambers@velocino.com.au

Rank: Member

Groups: Registered
Joined: 7/25/2015(UTC)
Posts: 17

Hi
Just a thought. I often use a scheme where I use a different character at the start of a line to signify what the line is. eg 'D' for data, 'S' for status, '#' for debugging (comment). If you were to adopt this mechanism, it would be easy for interacting programs to filter out the relevant data.

(Oh, and you might need a thread safe Serial.print).

:)

Mark
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error