Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 28-Oct-2018 09:23:12

jos
Member
Registered: 28-Oct-2018
Posts: 8

Sending data to Serial port

Hello,
I’ve communicated Arduino with OpenSpace without problems, sending values read in Arduino Esplora (button states, slider value) and receiving in OpenSpace with Serial plugIt.

Now, I want to do the opposite: send data from Openspace to Arduino, but I can only send “on” or “off” from OpenSpace to Arduino, connecting a sequence plugIt to a Serial instance with “Send” event (the other event available is “set com port”); the question is: how I  can send a specific value (other than “on” or “off” ) to the serial port, like the key pressed ? I’ve tested connecting a “Dialog list” without results, can I send the keypressed to the serial port ? (connecting a keyboard plugIt doesn’t work, only “keyup and keydown” outputs)
All ports are set ok and velocity BPS too (I can visualize data sent with a serial monitor) , there isn’t any problem in the serial connection
Thanks in advance.

Last edited by jos (28-Oct-2018 09:24:10)

Offline

#2 28-Oct-2018 10:03:20

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,360
Website

Re: Sending data to Serial port

Hello and welcome!

You have to set the values in the link parameter of the Serial.send action.
double clic on the link to set the parameter value

Offline

#3 28-Oct-2018 20:19:29

jos
Member
Registered: 28-Oct-2018
Posts: 8

Re: Sending data to Serial port

Thanks Arkeon for your fast response; it  works perfectly now, I’m  new to programming  in OpenSpace and don’t find some procedures, like how to do a UI  2D slider.. is it possible?  I’ve seen all examples and don’t see any , perhaps it has to be done with “physics slider” and working perpendicular to the camera? 

I’ve found a reference to a “slider control”, but don’t know how to use:
http://redmine.scolring.org/projects/op … lider.html

Good job and thanks for your efforts updating OpenSpace!

Last edited by jos (28-Oct-2018 20:20:15)

Offline

#4 28-Oct-2018 21:03:40

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,360
Website

Re: Sending data to Serial port

Hello,

UI are basic for now, you can use the dialog number plugit for example : http://www.openspace3d.com/documentatio … lugit.html

Otherwise you can also make an html page and use the web navigator plugIT if your app is for windows.

Offline

#5 29-Oct-2018 20:54:12

jos
Member
Registered: 28-Oct-2018
Posts: 8

Re: Sending data to Serial port

I'll try it; sorry if this is a stupid question, but i don't find the "Real-time graph" plugIt in new version, where is it? It could be wonderful to see input data sent from an Arduino in beautiful graphs and control analog inputs with the Signal generator plugIt  or with a slider controlled by user
Thanks!

Last edited by jos (29-Oct-2018 20:54:44)

Offline

#6 29-Oct-2018 21:03:10

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,360
Website

Re: Sending data to Serial port

Hello,

this one is in tools category : http://www.openspace3d.com/documentatio … graph.html

Offline

#7 30-Oct-2018 09:03:33

jos
Member
Registered: 28-Oct-2018
Posts: 8

Re: Sending data to Serial port

Thanks Arkeon, I’ve found it; now I will try to do some UI to send/receive data form Arduino and show it in the screen; by the way….I’m surprised how many input devices OpenSpace has by default, but it will be useful to interface with Arduino boards (and compatibles) in easier way, like using “Firmata”, a specific protocol that you can load in Arduino and communicates with host computer with direct instructions to access inputs and outputs. I don’t have enough knowledge in this matter, if somebody knows how to do, here is the library : Firmata Reference

And some examples in Processing https://playground.arduino.cc/interfacing/processing

Thanks for your help !

Offline

#8 30-Oct-2018 09:16:08

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,360
Website

Re: Sending data to Serial port

Interesting smile but weird I could not find any C/C++ FIRMATA client library ^^

--
Ha yes finally found some, it's about a 3 or 4 days job ^^
I don't have time for this now, but I'll keep it in mind!

Offline

#9 30-Oct-2018 10:06:10

jos
Member
Registered: 28-Oct-2018
Posts: 8

Re: Sending data to Serial port

oh wonderful ! I don't know enought C programming  to do the library or plugIt, but if I can help in any way  I'll be available to test it 

Another time, lot of thanks

Last edited by jos (30-Oct-2018 18:18:08)

Offline

Board footer

Powered by FluxBB