![]() |
Forum Index : Microcontroller and PC projects : Micromite V4.7 Beta 2 *NEW*
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
OA47 Guru ![]() Joined: 11/04/2012 Location: AustraliaPosts: 982 |
Here is the code I am using and I am trying to shift the single digit hour across one space or specified character before the digit. If Val(Left$(Time$,2)) < 12 Then
Text 5,1,Left$(Time$,2),LT,2,2,RGB(Cyan),RGB(Black) Else Hrs=Val(Left$(Time$,2))-12 Text 5,1,Str$(Hrs,2,0,"-"),LT,2,2,RGB(Cyan),RGB(Black) EndIf ![]() |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
It should work Graeme. I will have a look at it ASAP (I have a lot of things on at the moment). Geoff Geoff Graham - http://geoffg.net |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Hi Graeme and Geoff, I've just tried it and there does seem to be a problem with the STR$ function. STR$(hrs,2) only returns one character if its <10 hrs. When I was using it with the Micromite 1, V4.5 and with the LCD command it was working correctly. The following is a workaround: hours = VAL(LEFT$(TIME$,2))
IF hours < 12 THEN IF hours <10 THEN Text 5,1,"0"+STR$(hours)+":",LT,2,2,RGB(Cyan),RGB(Black) ELSE Text 5,1,STR$(hours)+":",LT,2,2,RGB(Cyan),RGB(Black) ENDIF ELSE hours = hours-12 IF hours <10 THEN Text 5,1,"0"+STR$(hours)+":",LT,2,2,RGB(Cyan),RGB(Black) ELSE Text 5,1,STR$(hours)+":",LT,2,2,RGB(Cyan),RGB(Black) ENDIF ENDIF You can replace "0" with " " of course if wanted. Greg |
||||
OA47 Guru ![]() Joined: 11/04/2012 Location: AustraliaPosts: 982 |
@Geoff, please don't take the report as a criticism or in need of urgent attention. I had written code to work around the issue and just thought I would bring it to your attention before a final release. I am very appreciative of all the work you have put in on these projects. Thankyou again @Greg , thankyou for confirming the issue and the offer of alternate code. GM |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
No, not a problem. It is just that I always try to respond immediately to any bugs but in this case time is not on my side. Geoff Geoff Graham - http://geoffg.net |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
The answer has just dawned on me!!!!! Font 2 does not have a space or a minus (-) character. So, when you specified either of these as the leading character MMBasic just skipped it as a non printable character. If you had tried: Text 5,1,Str$(Hrs,2,0,":"),LT,2,2,RGB(Cyan),RGB(Black)
it would have done what you expected because the colon (:) is in the character set. It seems to me that the space and the minus (-) characters are more important in a numeric character set than the colon so that is something that needs to be changed. Geoff Geoff Graham - http://geoffg.net |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Amazing, you can miss these things by a whisker - if I'd have just put the colon into Graeme's original code instead of after I'd been checking it out then it would have shown up. Glad it's you keeping track of this stuff Geoff and not me. Greg |
||||
Zonker![]() Guru ![]() Joined: 18/08/2012 Location: United StatesPosts: 767 |
Morning Gents... I finally got a chance to play with the new firmware... Nice..! I went back to the TFT MM demo programs and converted a meter object to the 2.4 inch touch panel to play around with... Still working on it... ![]() 2015-05-25_070042_2-4_inch_meter_test.zip |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10254 |
Zonker Very nice demo - congrats Peter |
||||
OA47 Guru ![]() Joined: 11/04/2012 Location: AustraliaPosts: 982 |
@Zonker Looks Great @Geoffg We need the colon as the delimiter for Time$ You have done the Bitmap command for other characters needed. Thanks for the heads up on where I went wrong. GM |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Yes, nice job Zonker. I've got it running on a 2.8" with exactly the same code and connections and it looks great. It's amazing how much extra display area there is with the 2.8" screen - it's 7.8 sq" Vs 5.7 sq" and not much different current draw, about 50mA directly off the 3.3v supply. Greg |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
I have figured out a way to get the space, +, -, = and : in the font. So all is good. They will be in the next beta. Geoff Geoff Graham - http://geoffg.net |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2437 |
geoff: i presume storing the fonts (as bitmaps) is taking up a fair chunk of flash? i wonder if it would be practical to switch to storing the characters instead as a series of lines? or even as still bitmaps but in an external eeprom. my 2.2" display is currently winging its way from china. i went for one WITHOUT a touch panel for better clarity. a few years back when trialing different displays in a product we found that the resistive touch panels of the day had a noticeable impact on brightness, clarity, as well as quickly falling victim to scuffing from dirty fingers and gloves. it would be nice to think that in the not too distance future capacitive touch panels will start to filter down to the hobby market. cheers, rob :-) |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1579 |
hmm, seems the MM lost his SPI ability? (if you don't disable the LCDPANEL) ![]() ... I wanted to use the new LCD capability with a SPI thermocouple circuit (MAX31855). I got it already working with Peters Graphic library. A display for my Reflow-(Pizza)-oven (3x SPI: LCD, Touch and MAX31855 thermocouple amplifier). Some countries (ie Germany) use the comma "," for numbers as decimal mark (1/4 = 0,25). Can we have it in the future, please? Regards Michael /* Demo code on 28 pinner (Micks Backpack 170). OPTION LCDPANEL ILI9341,L,4,5,6 OPTION TOUCH 7,2 */ @Zonker good job! I like it! ![]() (I thought it was my idea!) ![]() ![]() causality ≠ correlation ≠ coincidence |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
Hi Twofingers, are you saying that if you disable the lcd then you can do your spi temperature measurement and then re-enable the lcd and this will work? Also, are you using a pid profile with your pizza oven? Just curious. Thanks for all your help! |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1579 |
Hi Jim, ![]() with Micromite V4.7 Beta 3 I can only use SPI with PeterMs Graphic library (OPTION LCDPANEL disable, OPTION TOUCH disable). No, I don't use a pid profile. The oven runs at full power with manual power off. I think that's good enough. I use the Micromite only to observe the temperature. But I'm prepared to control the SSR by MM. For that I have to isolate (fiberglass mat) the oven better. To build up a oven control is a challenge, I think. Today I encountered some issue with GUI CALIBRATE. I get always a calibration error regardless how exact I execute the calibration process. I can't use the Touch function. With PeterM's Graphic library there are never problems. Perhaps can someone help? Regards Michael causality ≠ correlation ≠ coincidence |
||||
jman![]() Guru ![]() Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Graeme Meager was kind enough to share his code with me. I added my NTP routine and the result is here. Graphic Clock I could not resist the boot screen :) Regards Jman |
||||
aargee Senior Member ![]() Joined: 21/08/2008 Location: AustraliaPosts: 255 |
Hi Jman, Do you have a link for that display? Edit.. ... ahh never mind. Found one. ![]() For crying out loud, all I wanted to do was flash this blasted LED. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
If GUI CALIBRATE detects an error of more than 8 pixels it will issue a warning. But it is just a warning, you can still use touch. After the warning use GUI TEST TOUCH to check the actual error, if it is not significant you can happily ignore the warning. Geoff Geoff Graham - http://geoffg.net |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1579 |
Hi Geoff, thanks for the quick response! Thats useful! I tried it again with V4.7B8: a. OPTION LCDPANEL ILI9341,L,4,5,6/OPTION TOUCH 7,2/GUI CALIBRATION/GUI TEST TOUCH 1. with calibration error I can't use the Touch function. a. OPTION LCDPANEL disable, OPTION TOUCH disable b. OPTION LCDPANEL ILI9341,L,4,5,6/OPTION TOUCH 7,2/GUI CALIBRATION/GUI TEST TOUCH 2. with successful calibration I was able to use the Touch function. a. OPTION LCDPANEL disable, OPTION TOUCH disable b. OPTION LCDPANEL ILI9341,L,4,5,6/OPTION TOUCH 7,2/GUI CALIBRATION/GUI TEST TOUCH 3. with calibration error I still can NOT use the Touch function. a. OPTION LCDPANEL disable, OPTION TOUCH disable b. OPTION LCDPANEL ILI9341,L,4,5,6/OPTION TOUCH 7,2/GUI CALIBRATION/GUI TEST TOUCH 4. with successful calibration I was able to use the Touch function. Seems something is wrong (hopefully not ME! ![]() Michael causality ≠ correlation ≠ coincidence |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |