Gauge

Support forum for MegunoLink
Post Reply
Siderits
Posts: 2
Joined: Fri Jul 06, 2018 1:29 am

Gauge

Post by Siderits » Mon Jul 09, 2018 1:20 am

Would anyone have some insight about why my Gauge is stuck?

I'm using the statement MyPanel.GetValue(F("MyGauge"), SensorValue); in the Loop section of the Arduino sketch, but the visualizer shows the following message: some ASCII characters and the sentence "doesn't exist in MyGauge".

The TimePlot works fine with the analogRead(0) which stores to the variable SensorValue.

Thanks!

Rich

philr
Posts: 180
Joined: Mon May 26, 2014 10:58 am

Re: Gauge

Post by philr » Mon Jul 09, 2018 7:34 pm

Hi Rich, are you trying to "get" the value from your gauge or "set" the gauge to show a value? You're example shows a get.

Cheers
Phil

Siderits
Posts: 2
Joined: Fri Jul 06, 2018 1:29 am

Re: Gauge

Post by Siderits » Tue Jul 10, 2018 12:41 am

Hi Phil:

I have a simple light sensor setup on a breadboard that is updating a TimePlot with no problem, but would like to have a gauge also reading the SensorValue from the photo-resistor.

I can set the gauge value with a statement like: MyPanel.SetNumber(F("MyGauge"), 42); but I can't figure out how to read the photo-resistor value thats coming in from int SensorValue = analogRead(0); and then have that number display on the gauge. There doesn't yet seem to be an example of a gauge script to follow and learn from.

Thanks

Richard

philr
Posts: 180
Joined: Mon May 26, 2014 10:58 am

Re: Gauge

Post by philr » Tue Jul 10, 2018 7:55 am

Hi Richard, so you would just go MyPanel.SetNumber(F("MyGauge"),analogRead(0)). or:

SensorValue = analogRead(0);
MyPanel.SetNumber(F("MyGauge"),SensorValue);

Does that make sense?

philr
Posts: 180
Joined: Mon May 26, 2014 10:58 am

Re: Gauge

Post by philr » Tue Jul 10, 2018 8:19 am

Attached is an example which includes setting the gauge. The .ino files is the arduino program and the .mlpz file is a pre-made megunolink interface.
UpdatingInterfaceFromArduino.zip
(30.77 KiB) Downloaded 2 times
Cheers
Phil

Post Reply