Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:13 02 Aug 2025 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 : MM2: Searching for the perfect gauge

     Page 3 of 3    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 11:03pm 31 Jan 2016
Copy link to clipboard 
Print this post

By the way Peter, your demo reached the cover of this month's Silicon Chip magazine (you were properly credited in the main article):



Geoff Graham - http://geoffg.net
 
miyek.ard
Newbie

Joined: 31/03/2018
Location: Malaysia
Posts: 24
Posted: 10:01am 05 Apr 2018
Copy link to clipboard 
Print this post

Hi Peter.

I just discovered about your gauge project using Micromite LCD Backpack. I have a few questions on your coding.


initgauge(0,53,60,49,1,-150,-100,0,75,150,"EGT")
initgauge(1,159,60,49,1,-150,-120,0,120,150,"CHT")
initgauge(2,265,60,49,1,-150,-50,0,50,150,"OIL")
initgauge(3,53,180,49,1,-120,-120,0,75,120,"AMP")
initgauge(4,159,180,49,1,-90,-90,0,75,90,"OAT")
initgauge(5,265,180,49,1,-150,-150,0,75,150,"VOLT")


1. Is the scale of the gauge constant from -150 to 150? I am doing some project which have range of 0 to 1000ml, so how can I vary the scale?

2. How to make the pointer moving depends on the output of the sensor? For example water level sensor.

I am so sorry to disturb you with this old post and just wanna let you know I am beginner to Micromite. I really wish you can help me on my programming

Others also encourage to reply my questions. Thank you!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 04:33pm 05 Apr 2018
Copy link to clipboard 
Print this post

  Quote  1. Is the scale of the gauge constant from -150 to 150? I am doing some project which have range of 0 to 1000ml, so how can I vary the scale?


call the initialise subroutine with the parameters that suit your application

' Routine to initialise a gauge
' Parameters are:
' gaugeindex
' x-coordinate of centre of gauge
' y-coordinate of centre of gauge
' radius of gauge
' font size
' start radial of white segment (-180 to 180)
' start radial of green segment (-180 to 180, must be greater or equal to start of previous segment)
' start radial of yellow segment (-180 to 180, must be greater or equal to start of previous segment)
' start radial of red segment (-180 to 180, must be greater or equal to start of previous segment)
' start radial of black segment (-180 to 180, must be greater or equal to start of previous segment)
' string to display as gauge title
' spacing in degrees for any scale markers, set to zero or omit if not required

  Quote  2. How to make the pointer moving depends on the output of the sensor? For example water level sensor.

Just convert the sensor reading to a suitable angle and call the needle subroutine
each time you get a new sensor value
' Routine to draw a pointer
' Parameters are:
' gaugeindex
' radial of pointer to be drawn (0-360 degrees)
' colour to draw pointer
'
Sub needle(gaugeindex as integer, angle As integer, col As integer, value$ as string)

 
     Page 3 of 3    
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025