Interface panel for my Hardware

Share your projects using MegunoLink Pro here!
Post Reply
rsfoto
Posts: 36
Joined: Mon Nov 20, 2017 12:09 am

Tue Nov 21, 2017 1:43 am

Hi,

I am developping a hardware and would like to have the ability to control it or see data from my Arduino. I have been reading here but looks like I am having trouble to understand all this.

So my question is:

My hardware is collecting data and I would like to see this data (just numbers) in a textbox so I can see what is happening with the sensor I have.

At the moment it is in development and in order to see the data the sensor is collecting I use the Serial Terminal. So in Arduino I have the command

Serial.print(a_readvariable);

Now I want to see that (a_readvariable) in a Text Box (just one number not a row of numbers) I see in the Serial Terminal. This means Arduino sends a number, I see it in the Text Box, erase it when the next number comes and so on ...

After I bought this Meguno Link Pro software I thought Meguno does intercept this commands and present them in the Interface PAnel but it seems more complicated then that.

I would appreciate if somebody gives me some code so I can understand how to get the messages from my Arduino into an Interface panel.

Also as I am activating some switches via the Arduino I would like to know how to change a Box in color so I now which switxh is been activated for a certain time.

It would be quite helpful to see more realistic code here in this forum with an explanation of what it does. All the stuff I have read in the Meguno website are very vague.

Thank you and regards Rainer
regards Rainer

Observatorio Real de 14, SLP, MEX
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Tue Nov 21, 2017 1:49 am

Hi Rainer, I recommend you use the table instead of a textbox. See this example
https://github.com/Megunolink/MLP/blob/ ... oTable.ino

If you program your arduino with this example and open the table visualier in megunolink you will see two numbers changing over time. One labelled fish and one labelled turtles. You could then modify this example to have it labelled "MyVariable" and have it update the value with "a_readvariable".

If you really want to update values on the interface panel then this page is your best bet.
https://www.megunolink.com/documentatio ... ace-panel/

Cheers
Phil
rsfoto
Posts: 36
Joined: Mon Nov 20, 2017 12:09 am

Tue Nov 21, 2017 2:47 am

Hi Phil,

Thank You- Let me see if I understood correctly. I have the commands of the Arduino programming like

Serial.print(whatever);

And additional to that I need now to repeat all my Serial.print(¿?); commands using your library MegunoLink.h and so

Serial.print(¿?) translated in order to represent the value in my UI Panel = " SetNumber(ControlName, Value) where "ControlName" is the Name I gave to the Box in the Panel and "Value" is my variable in the Arduino sketch ?

Did I Understand that correctly ?

regards Rainer
regards Rainer

Observatorio Real de 14, SLP, MEX
rsfoto
Posts: 36
Joined: Mon Nov 20, 2017 12:09 am

Tue Nov 21, 2017 2:54 am

Hi Phil,

I forgot to ask. If I download your examples and upload the sketches in one of my Arduino bords and let it run I will see the UI and how it works ?

Thanks and regards Rainer
regards Rainer

Observatorio Real de 14, SLP, MEX
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Tue Nov 21, 2017 2:59 am

Yes exactly. MegunoLink isn't able to just pick data out of a serial stream. It requires a specific protocol is used. For example this is a plotting message:
{TIMEPLOT:Cos|DATA|Cosine|T|-0.94}

Our messages require a "{" and "}" at each end with specific contents between. Our Arduino library takes care of most of the work for you which is why in the table example you would send

MyTable.SendData("MyVariable", myvariable);
That would be converted into a table message which you will see in the monitor once you have the example running.

Yes to your second question too. The best way to learn is to play around with the arduino examples. Inside the folder for each of the examples is a megunolink interface (.mlx) and arduino program (.ino). If you program the example to your arduino and open the interface then you should see each example in action immediately.

Cheers
Phil
rsfoto
Posts: 36
Joined: Mon Nov 20, 2017 12:09 am

Tue Nov 21, 2017 3:09 am

... and open the interface ...
Thanks and how exactly do I open the Interface ?

Is it embedded in the *.ino sketch or do I need to run your software ?

If I distribute my hardware and want to include the UI I created for my Hardware I guess I need to get your builder.

Let me give you more specific data about my sketch.

I have a module like the one below
/*******************************************************************/

/* módulo leer sensor */

void leerRA()
{
for(int i = 0;i < 20; i++ )
{
ejeRA_A0A1 = ads1115.readADC_Differential_0_1();
sumaRA_A0A1 = sumaRA_A0A1 + ejeRA_A0A1;
delay(50);
#ifdef escribirEjes
writeRA();
#endif
}
RA_A0A1 = (sumaRA_A0A1 / 20);
#ifdef escribirEjes
writeRA_A0A1();
#endif
}
and I want to write into the numeric box the variable RA_A0A1

My UI Panel would have the name "RS-ol Guider"

How would I now declare that ?

The numeric box could have the name RA_A0A1 ¿ is that allowed ? being the variable RA_A0A1 ?

etc.

Questions over questions :-)

regards Rainer
regards Rainer

Observatorio Real de 14, SLP, MEX
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Tue Nov 21, 2017 5:37 am

Have you installed the MegunoLink library to your Arduino IDE? if not follow this page
https://www.megunolink.com/documentatio ... tegration/

Once installed you can look on the main MegunoLink toolbar to see a "Library Examples" button. Click on that and locate the table example from the submenus. Inside that example is two links. One to the MegunoLink interface and one to the arduino program. Open both. Program the arduino, set the COM port for your arduino in megunolink, connect, and you should see the table populate.

As for your example code, I'd try and get the table example going first. Once that's working it will be easy for you to figure out how to add your code to it.

Cheers
Phil
rsfoto
Posts: 36
Joined: Mon Nov 20, 2017 12:09 am

Tue Nov 21, 2017 8:32 pm

Thank You. I have sent you an e-mail via the web page under contact.

regards
regards Rainer

Observatorio Real de 14, SLP, MEX
Post Reply