How to send value to Arduino from TrackBarWithIndicator (slider)?

Support forum for MegunoLink
hugh
Posts: 9
Joined: Sat Dec 31, 2016 4:59 pm

Re: How to send value to Arduino from TrackBarWithIndicator (slider)?

Post by hugh » Thu Dec 06, 2018 9:39 am

Hi Phil,

I have sent you my MegUno code and the Arduino Mega code that it works with via support@megunolink.com as suggested.

I have never tried using Command Handler. My coding skills - or more accurately lack of - are firmly rooted in the glory days of Algol 60 and Dartmouth Basic. So, my serial interface from the MegUno UI Console back to my Arduino code uses very simple character based codes. As an example, the SaveToEEPROM command to save the Dome parameter is sent as the string dse/n and the command to save the shutter parameters is sent as sse/n.
The actual observatory controller runs on 3 separate microprocessors. An Arduino Mega that is the overall controller and two Teensy 3.2 boards. One Teensy drives the dome rotation motor and the other - via an XBee wireless link - drives the shutter motor. This configuration owes more to a process of Darwinian evolution than any actual design process. However, it does work and apart from a few tweaks I am relatively happy with it. The whole lot uses the same very primitive serial comms scheme. I currently use 3 of the 4 available serial ports of the Mega. The USB serial connects to MegUnoLink, Serial1 connects to the dome Teensy and Serial3 connects to the shutter Teensy.

The actual scheme is simply to check whether serial data is available in every loop iteration and if so, to save the incoming characters until a stop character is received (newline) then parse the received string using case statements.

So, the point of all the above is to hopefully show why I would be very reluctant to make any significant alterations to the way I send and receive serial data. I will have a look at Command Handler and if I can, I will try it but I am not very optimistic.

Thanks again for your input. It is very reassuring to be able to get some suggestions and assistance.

Regards, Hugh

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

Re: How to send value to Arduino from TrackBarWithIndicator (slider)?

Post by philr » Sat Dec 08, 2018 12:44 am

Hi Hugh, check out this example I just made.
MultipleParametersOneButton.zip
(11.66 KiB) Downloaded 3 times
It demonstrates how you can send multiple parameters in a single click of the "Write to EEPROM" button. I suggest you follow this as a guide for your system.

Cheers
Phil

hugh
Posts: 9
Joined: Sat Dec 31, 2016 4:59 pm

Re: How to send value to Arduino from TrackBarWithIndicator (slider)?

Post by hugh » Mon Dec 10, 2018 8:49 am

Hi Phil,

Many thanks for posting that. I shall give it a try in the next day or two.

Regards, Hugh

Post Reply