Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 04:06 30 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM Code help

Author Message
ronee
Newbie

Joined: 08/01/2012
Location: Canada
Posts: 20
Posted: 07:47am 10 Jan 2016
Copy link to clipboard 
Print this post


I am in need of code help. The task is to read and display a digital read out. The data will have been processed and will be in the form of a serial nature consisting of a repeating XYZW with a possible number after each alphabet character of possibly six parts, “00.0000”.

I can code for two boxes X and Y and print to them but then I get lost.

So when an X is present I want to take the number after it and store it somewhere, then print it to the X box. This would be a gosub? If the number is the same, “do nothing” if the number has changed store
and print the new number, then return to main.

Same then for Y's number. At this point there are only the two readouts, so only two boxes required.

Simple? Not for me!
----------------------------------------

Background:

This is from Yuriy's toys...

http://www.yuriystoys.com/p/android-dro.html

He uses a TI Launch pad to crunch the numbers then to an Android device for the readout. I thought a simple black and white Maximite could do the readout to a VGA monitor as being simpler than Android to HDMI.
-----------------------------------------------------------------------

The data steam would be in this format probably...
...the launch pad microcontroller decodes the output from the scales and stores the positions for each of the three scales into a
signed 32 bit integer. When the last bit is read, the positions are converted to strings in the following format:
Single letter axis name
Optional minus sign
One to eight digits
Terminator (semicolon)
Once the strings are constructed, they are simply written to the UART port (using printf() function)
and the process is repeated again.
The readout could look like this (without the quotes): "x-232;y4435;z124434;x-234;" and so on.
Each block can be expressed using regular expression [xyz]-?\d{1,8};.
-----------------------------------
My replication


https://youtu.be/vqE6M4vfpiU

Thanks

Ron
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024