Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:46 13 Nov 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 : Micromite GUI frame and radio buttons iss

Author Message
shoots

Newbie

Joined: 31/07/2011
Location: Australia
Posts: 32
Posted: 05:51am 09 Jun 2019
Copy link to clipboard 
Print this post

Hi,

Micromite plus 100 with touch screen/LCDPANEL SSD1963_5A,L

I am having issues setting up two sets of radio buttons, each with its own frame.
The first set of buttons- 2 &3 are within frame 1. The second set - 7 & 8 are within frame 6. On their own each works ok but with both frames and sets of buttons configured the upper frame only works ok except when a button in the lower frame is touched the upper radio button goes off. The lower frame radio buttons just go on and when touched they do not go off (you can end up with both on) and are not affected by the upper buttons being touched.

I did comment out the top frame and buttons and set up a another frame and buttons below frame 6 and had the same issue- the top frame etc partly worked.

I have an interrupt that is triggered when a button is touched and this works ok for all buttons so I know they are registering. It is just that the interaction of the buttons is not staying within their respective frames!

Is it only possible to have one frame and set of buttons per page?

The spinbox and other items wok ok.

Below is the code related to setting up the frame and buttons:

GUI Frame #1, "CONTROL METHOD", 15, 15, 600, 100', RGB(200,20,255)
GUI Radio #2, "PRESSURE", 60, 65, 15', RED
GUI Radio #3, "SPEED", 400, 65, 15', RED
CtrlVal(3) = 1
GUI SWITCH #4, "Start 20", 50, 400, 200, 80,RGB(white), RGB(brown)
CtrlVal(4) =1

GUI SPINBOX #5, 50, 350, 200, 50,RGB(white),RGB(red),10, 10, 100', RGB(white), RGB(brown)', RGB(200,20,255), RGB(100,125,155)
CtrlVal(5) =100
'start pressure set up
GUI Frame #6, "Pressure cm H20", 30, 200, 700, 100', RGB(200,20,255)
GUI Radio #7, "20", 100, 250, 15
GUI Radio #8, "40", 400, 250, 15

Any advice would be much appreciated.

Thank you.
Regards,
Peter
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 09:48am 09 Jun 2019
Copy link to clipboard 
Print this post

This should not be happening. I have people staying with me for a few days and when they leave I can have a look at it.

Has anyone else seen this sort of thing?
Geoff Graham - http://geoffg.net
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 10:15am 09 Jun 2019
Copy link to clipboard 
Print this post

hi shoots
it seems that framebox work only when they are in left/right position and not in up/down position

I put here your code with changes (frame position do/loop and interrupt functions)


cls
GUI Interrupt TouchDown, TouchUp

GUI SPINBOX #5, 50, 350, 200, 50,RGB(white),RGB(red),10, 10, 100
CtrlVal(5) =50

GUI SWITCH #4, "Start 20", 300, 350, 200, 80,RGB(white), RGB(brown)
CtrlVal(4) =1

GUI Frame #1, "CONTROL METHOD", 15, 15, 200, 300', RGB(200,20,255)
GUI Radio #2, "PRESSURE", 50, 100, 15', RED
GUI Radio #3, "SPEED", 50,200
CtrlVal(3) = 1
'start pressure set up
GUI Frame #6, "Pressure cm H20", 250, 15, 200, 300', RGB(200,20,255)
GUI Radio #7, "20", 300,100, 15
GUI Radio #8, "40", 300, 200
do
loop

Sub TouchDown
Select Case Touch(REF) ' find out the control touched
Case 4 ' spin
print "start"

Case 5
print CtrlVal(5)

Case 2
print "pressure"

Case 3
print "speed"

Case 7
print "20"

Case 8
print "40"

End Select
End Sub
' interrupt routine when the touch is removed
Sub TouchUp
Select Case Touch(LASTREF)
Case 5
print CtrlVal(5)
End Select
End Sub
Edited by goc30 2019-06-10
 
shoots

Newbie

Joined: 31/07/2011
Location: Australia
Posts: 32
Posted: 01:25pm 09 Jun 2019
Copy link to clipboard 
Print this post

Hi goc30,

I would never have guessed that! Thank you- indeed it resolves the issue and a change in layout is not a problem.

One other question- your program results in a beep from the piezo only when the radio button itself is pressed while mine beeps when any part of the screen is touched- even where there is no button. What is the secret to this?

Thank you.
Regards,
Peter
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 03:06pm 09 Jun 2019
Copy link to clipboard 
Print this post

  shoots said   Hi goc30,



One other question- your program results in a beep from the piezo only when the radio button itself is pressed while mine beeps when any part of the screen is touched- even where there is no button. What is the secret to this?


you have an beep each time you touch screen if you put "click_pin" on "option touch"


OPTION TOUCHT_CS pin, T_IRQ pin [, click pin]
'click pin' specifies an optional I/O pin that will be driven briefly high when a
screen control is touched. This can be used to drive a small Piezo buzzer.

but in your code you can use "BEEP" function on interrupt subroutine
exemple:

Sub TouchDown
Select Case Touch(REF)
Case pb_test ' the alarm test button
CtrlVal(led_alarm) = 1
GUI beep 250

End Select
End Sub
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 11:39pm 09 Jun 2019
Copy link to clipboard 
Print this post

Thanks goc. I will add that one to my list of bugs to be fixed.
Geoff Graham - http://geoffg.net
 
shoots

Newbie

Joined: 31/07/2011
Location: Australia
Posts: 32
Posted: 12:16am 10 Jun 2019
Copy link to clipboard 
Print this post

Thanks Goc, I'll give that a go. Adds another level of sophistication to the project!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9755
Posted: 10:08pm 10 Jun 2019
Copy link to clipboard 
Print this post

Well done, goc30, for helping to define that bug so it can be squished.
Smoke makes things work. When the smoke gets out, it stops!
 
shoots

Newbie

Joined: 31/07/2011
Location: Australia
Posts: 32
Posted: 12:47pm 11 Jun 2019
Copy link to clipboard 
Print this post

Hi Guys,

Thank you for the suggestions.

I have reconfigured with OPTION TOUCH 1, 40 and now I do not have the beep every time the screen is touched, but the GUI beep xxx command does not work and I can see no way to make it so without the OPTION TOUCH [,click pin] set to the pin number-39.

this is the message returned from the serial port when it encounters the command GUI beep 20:

OPTION LCDPANEL SSD1963_5A, LANDSCAPE
OPTION TOUCH 1, 40
GUI CALIBRATE 1, 125, 3870, 2049, -1296
141
[342] GUI beep 20
Error: Click option not set

It did not matter if I setup pin 39 as a digital output or not with SETPIN 39,DOUT

Am I missing something in the configuration?

Regards,
PeterEdited by shoots 2019-06-12
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 05:02pm 11 Jun 2019
Copy link to clipboard 
Print this post

hi shoot

for click you must declare pin connected with buzzer, AND pin used for interrupt (not same) AND chip Select pin


OPTION TOUCH T_CS pin, T_IRQ pin [, click pin]

your option touch is not good
OPTION TOUCH 1,40 is bad
you must declare

OPTION TOUCH chip select pi, interrupt pin, buzzer pin
OPTION TOUCH 1,40,39 if 40 is interrupt pin and 39 is buzzer pin

Edited by goc30 2019-06-13
 
shoots

Newbie

Joined: 31/07/2011
Location: Australia
Posts: 32
Posted: 01:02am 12 Jun 2019
Copy link to clipboard 
Print this post

Thank you Groc, I think I see where I went wrong.... I had a Gui beep command at the beginning of the interrupt routine. This is why I was getting a beep for any and every touch. When I get home from work I'll reinstate the option touch click parameter and remove the offending gui beep command.

Thanks for the patient help!!
Regards
Peter
 
shoots

Newbie

Joined: 31/07/2011
Location: Australia
Posts: 32
Posted: 02:10pm 12 Jun 2019
Copy link to clipboard 
Print this post

I gave it a try this evening and it worked a treat. It was the stray GUI beep I had put at the beginning of the interrupt.

Thank you for the help- and without your first bit of code goc I would not have realised what was possible!

And thank you to Geoff- your creation of the Micromite and MM basic has opened up so much enjoyment, learning and satisfaction in electronics and programming for so many. And in such a affordable package. It would be interesting to know how many MMs have been put together and what sort of projects have been undertaken.

Cheers,
Peter
 
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