![]() |
Forum Index : Microcontroller and PC projects : MM2: Searching for the perfect gauge
![]() ![]() |
|||||
Author | Message | ||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
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: MalaysiaPosts: 24 |
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 KingdomPosts: 10315 |
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 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) |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |