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 runs 65k VGA 800x480 resolution
Page 2 of 2 | |||||
Author | Message | ||||
TC 72 Newbie Joined: 05/02/2014 Location: FrancePosts: 15 |
hello zonker thank you for this idea, but I already tried the code to manage the display is in C, I got to do my interface but not managed the touchscreen. did you read the basic program geoff? Can you explain the operation of sub keys on playback? I just deleted the " ' "(REM) before the establishment and management functions of the touchscreen. Be careful if you want to see the keys and have no error on the part of the display of coordinates must be set according to the key type of display. thank you in advance for your help. has soon thierry |
||||
plasma Guru Joined: 08/04/2012 Location: GermanyPosts: 437 |
for this price you can also put a raspberry pi or beaglebone to the tv. even you get HD , much moore color und a faster rs232 now write you own software to read micromite commands from serial and create a full hd gui with. overpowered, overpriced but possible if u will |
||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
@TC 72.. Well, I too have to admit that it's a bit overpriced..!! But at the time, there was no "TFT Maximite"... I wanted to create a GUI of some type that the pilot could quickly get to the data needed... And, BTW, I didn't write a single line of code for the display. I used the "Visi-genie" part of the IDE and just created the screen layouts containing the displayed objects and compiled it into a working piece of code inside the GPU. Then, just sent properly formatted serial strings to the unit to update the objects. Kinda easy... Still, I wasn't happy about the cost... After the TFT MM came out, Jman helped me to get a prototype TFT unit rumming using a UBW32 board.. I am (so far) quite happy with it, and would like to create a new PCB and repackage this neat design... But, then got involved with the uMite Bata testing so have been delayed a bit... Will get back on track soon... I like the uMite for doing all the SPI based data collection work for the project, as this will help in creating cheap "potted module" based building blocks for the system all connected through the Rs-485 comm line... Anyway, nuff babble... Thanks again Gents..!! |
||||
TC 72 Newbie Joined: 05/02/2014 Location: FrancePosts: 15 |
thank you to you for your comments the choice of μlcd 4dsystem was made ​​two years ago because I thought I could do what I wanted with the only intelligence processor display. out I do not know C programming. more poster has an 8-bit processor that which requires to do a lot of manipulation for calculation. when the rasberry I do not know of all the world of linux and or android. if there is an interpreter in basic mmbasic as simple as this could interresser me. if you have a source I'm interested. by cons for my loop problem asks me have you looked? see you soon and thank you again thierry |
||||
TC 72 Newbie Joined: 05/02/2014 Location: FrancePosts: 15 |
hello all I solved my little problem operating touchscreen. in fact it is the reading loop keys must be dimensioned. that is why I asked the question to the author, the demo works in this state does it. no answer so I looked .... thank you to everyone who took the time to read and wonder. thierry |
||||
psergiu Regular Member Joined: 09/02/2013 Location: United StatesPosts: 83 |
That's very good, congratulations ! Can you please post some updated BASC code in here so next time somebody else has the same issue can find-it easily ? Thanks. |
||||
TC 72 Newbie Joined: 05/02/2014 Location: FrancePosts: 15 |
hello here is what I am running I still have a big problem is the speed. must hold the button for 1 second at 1.5 it is detected. I am looking ...... ps: desolated my comments are in french has soon thierry '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''' ' demo of the graphics library for the 4D-Systems PICASSO range of touch LCDs ' this has been tested on the 4.3 inch and 3.2 inch serial displays ' models: uLCD43(SGC) and uLCD-32PT(SGC) ' ' the demo displays the time and some other graphics (see the photo) ' buttons are not used but can easily be added ' ' Geoff Graham, March 2012 ' 'ajout d'un pavé numerique de 0 a 9 avec touche correction et touche validation 'affichage sur le lcd de la valeur de la touche du nombre de frappe ' de la valeur du nombre tapé ' 'la touche validation est non active ' ' chevallier thierry mars 2014 ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''' ' open the display LCDOpen 4 '''''''''''''''''''''''''''''''''''''''''''''''''''' 'definition du hard SetPin 1,1 SetPin 2,1 'couleurs et positions TCol = RGB(0,1,1) ' time display colour and position TVPos = 0 WnCol = RGB(0,0,0) WCol = RGB(0,.8,0) ' water display colour and position WVpos = 120 bncol = RGB(0,0,0) BCol = RGB(1,0,0) ' battery display colour and position BVpos = 156 ICol = RGB(0.9,0.9,0) ' inside temperatures display colour and position IVpos = 198 : IHpos = 45 OCol = RGB(0.9,0.9,0) ' outside temperatures display colour and position OVpos = 198 : OHpos = 196 '****************************************************** '***variables T = 0 'nettoyage des ecrans LCDCLS ' clear the screen and any buttons Cls MainScreen: Do 'temp1 = Pin(1)*100 'temp1 = (temp1-50)*1.2 'T1 = Int(temp1) 'T1S = Int(T1/7.15) 'If T1<0 Then T1= 0 'If T1>215 Then T1= 215 'T1 = Abs(T1) 'temp2 = Pin(2)*100 'temp2 = (temp2-50)*1.3 'T2 = Int(temp2) 'T2S = Int(T2/7.15) 'If T2<0 Then T2= 0 'If T2>215 Then T2= 215 'T2 = Abs(T2) Print " prog en cour" 'Print@(10,10) temp1; print@(150,10) temp2 'Print "T1 :",T1; print "T2 :",T2 'Print "T1S :",T1S; print "T2S :",T2S Print@(150,130)T Print@(150,150)val '************boutons******************** ' this demo does not have any butons but this is how you would set them up '****positionnement et labelisation des boutons 'exemple de bouton sans label ici la totalite de l'ecran 'LCDBSetup 0,0, "", 240, 100 ' button not labeled (area of the screen)n'est pas utilise LCDBSetup 0, 0, "1" ' button labeled t1 LCDBSetup 45, 0, "2" ' button labeled t2 LCDBSetup 90, 0, "3" ' button labeled t3 LCDBSetup 0,50, "4" ' button labeled t4 LCDBSetup 45,50, "5" ' button labeled t5 LCDBSetup 90,50, "6" ' button labeled t6 LCDBSetup 0,100, "7" ' button labeled t7 LCDBSetup 45,100, "8" ' button labeled t8 LCDBSetup 90,100, "9" ' button labeled t9 LCDBSetup 0,150, "C" ' button labeled t10 LCDBSetup 45,150, "0" ' button labeled t11 LCDBSetup 90,150, "V" ' button labeled t12 '*******************fin boutons*********************** 'LCDPrint 0, WVpos+2, "Temperature", WCol, 15 'LCDLine 96, WVpos, 319, WVpos+20, WCol, 1 'LCDLine 100+T2, WVpos + 4, 318, WVpos+16, WnCol, 2 'LCDLine 100, WVpos + 4, 100+T2, WVpos+16, WCol, 2 'LCDPrint 0, BVpos+2, "Temperature", BCol, 15 'LCDLine 96, BVpos, 319, BVpos+20, BCol, 1 'LCDLine 100+T1, BVpos + 4, 318, BVpos+16, BnCol, 2 'LCDLine 100, BVpos + 4, 100+T1, BVpos+16, BCol, 2 'LCDPrint IHPos, IVpos,Str$(T1S), ICol, 30 'LCDPrint IHPos-30, IVPos + 8, "T", ICol, 12 'LCDPrint IHPos-30, IVPos + 24, "1", ICol, 12 'LCDPrint IHPos+80, IVPos, "C", ICol, 13 'LCDPrint OHPos, OVpos,Str$(T2S), OCol, 30 'LCDPrint OHPos+110, OVPos + 2, " ", OCol, 12 'LCDPrint OHPos+110, OVPos + 16, "T", OCol, 12 'LCDPrint OHPos+110, OVPos + 30, "2", OCol, 12 'LCDPrint OHPos+80, OVPos, "C", OCol, 13 'Do ' this loop never ends ' If tlast$ <> Left$(Time$, 5) Then ' tlast$ = Left$(Time$, 5) ' hrs = Val(Left$(Time$, 2)) : min = Val(Mid$(Time$, 4, 2)) ' If hrs > 12 Then hrs = hrs - 12 ' If hrs >= 10 Then oset = 0 Else oset = 6 * 5 ' LCDPrint 10 + oset, TVPos, Format$(hrs, "%g") + ":" + Format$(min, "%02g"), TCol, 45 ' LCDPrint 26, TVPos+80, "Quantite silot", TCol, 10 'LCDPrint 26, TVPos, Str$(Pin(1)), TCol, 30 'LCDBsetup 25,30,"test1" 'LCDBsetup 176,30,"test2" 'LCDBsetup 25,198,"test3" ' LCDPrint 8, TVPos+80, Time$+" "+Date$, TCol, 21 ' this demo does not have any butons but this is how you would detect a ' button press and run the appropiate subrouting to handle the press On LCDTouch() GoSub t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12 lcdprint 130,10, Str$(T) 'lcdprint 130,30," " lcdprint 130,30, Str$(val) EndIf Loop ' this demo does not have any butons but this is an example of how you would ' handle a button press. Note that these are the target of GOSUB's t1: If T = 0 Then val = 1 Else val = (val*10) + 1 EndIf T = T +1 Return t2: If T = 0 Then val = 2 Else val = (val*10) + 2 EndIf T = T +1 Return t3: If T = 0 Then val = 3 Else val = (val*10) + 3 EndIf T = T +1 Return t4: If T = 0 Then val = 4 Else val = (val*10) + 4 EndIf T = T +1 Return t5: If T = 0 Then val = 5 Else val = (val*10) + 5 EndIf T = T +1 Return t6: If T = 0 Then val = 6 Else val = (val*10) + 6 EndIf T = T +1 Return t7: If T = 0 Then val = 7 Else val = (val*10) + 7 EndIf T = T +1 Return t8: If T = 0 Then val = 8 Else val = (val*10) + 8 EndIf T = T +1 Return t9: If T = 0 Then val = 9 Else val = (val*10) + 9 EndIf T = T +1 Return t10: lcdprint 130,30," " val = 0 t = 0 Return t11: If T = 0 Then val = 0 Else val = (val*10) + 0 EndIf T = T +1 Return t12: Print "V" ' fonction non utilse pour le moment Pause 250 Return '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''' ' graphics library for the 4D-Systems PICASSO range of touch LCDs ' this has been tested on the 4.3 inch and 3.2 inch serial displays ' models: uLCD43(SGC) and uLCD-32PT(SGC) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''' ' open the LCD display for access ' this resets the display and opens comms at 9600 baud ' com is the communication channel. ie, 3 for COM3: ' pin 17 is used to reset the display and should be connected to the RES ' pin on the LCD. This must be called once at the start of the program Sub LCDOpen com Dim LCDBut(15, 5) : Dim LCDBMsg$(15) ' these are used to record the buttons tableau agrandi a 15 Open "COM" + Chr$(com + 48) + ":9600" As #10 ' Open "COM4:115200" As #10 SetPin 17, 9 Pin(17) = 1 Pause 2000 Print #10, "U"; LCDGetAck ' Print #10, "Q" Chr$(13); ' LCDGetAck ' Close #10 'Open"com4:19200" As #10 Print #10, "Y" Chr$(5) Chr$(0); ' enable the touchscreen LCDGetAck ' he following is only needed if the display is in portrait mode Print #10, "Y" Chr$(4) Chr$(1); ' rotate a portrait screen to landscape LCDGetAck End Sub ' clear the LCD screen and any buttons that have been setup on it Sub LCDCLS Local i For i = 1 To 10 LCDBut(i, 0) = 0 Next i Print #10, "E"; LCDGetAck End Sub ' print a string on the LCD ' z and y are the coordinates, msg$ is the text ' c is the colour and f is the font (both are optional) ' f is two digits, the first is the scale and the second is the PICASO font Sub LCDPrint x, y, msg$, c, f Local scale, opaque If f = 0 Then f = 13 scale = (f\10) Mod 10 opaque = ((f\100) = 0) If scale = 0 Then scale = 1 f = f Mod 10 If c = -1 Or c = 0 Then c = RGB(1,1,1) Print #10, "O" Chr$(opaque); LCDGetAck If f > 3 Then f = f - 3 Print #10, "S" LCDWords$(2, x, y); Print #10, Chr$(f) LCDWords$(1, c); Print #10, Chr$(scale) Chr$(scale) msg$ Chr$(0); LCDGetAck End Sub ' draw a line or a box ' x1, y1, x2, y2 are the start and end coordinates, c is the colour ' b = 0 will draw a line, b = 1 will draw a box and b = 2 a filled box ' c and b are optional and will default to a white line Sub LCDLine x1, y1, x2, y2, c, b Local cmd$, pen If c = -1 Or (c = 0 And b = 0) Then c = RGB(1,1,1) If b = 0 Then cmd$ = "L" Else cmd$ = "r" Print #10, "p" Chr$(b = 1); LCDGetAck EndIf Print #10, cmd$ LCDWords$(5, x1, y1, x2, y2, c); LCDGetAck End Sub ' generate a colour index for the LCD ' r = red, g = green and b = blue ' the values can range from zero (full off) to 1 (fully on) Function RGB(r, g, b) RGB = Int(r * 31) * 2048 + Int(g * 63) * 32 + Int(b * 31) End Function ' draw a button on the screen and initialise it ' x and y are the top left coordinates of the button ' msg$ is the caption for the button. This can be a zero length string ' (ie, "") and in that case the button is not drawn and x1 and y1 are ' used to define an area on the screen which, if touched will return a ' button press. A maximum of 10 buttons can be defined. ' x1 and y1 are optional ' dessin des boutons ecritude des "labels" Sub LCDBSetup x, y, msg$, x1, y1 Local i For i = 1 To 12 If(LCDBut(i, 0) = 0) Then Exit For Next i If i > 15 Then Error LCDBut(i, 0) = 2: LCDBut(i, 1) = x: LCDBut(i, 2) = y LCDBMsg$(i) = msg$ If msg$ <> "" Then LCDBut(i, 3) = x + Len(msg$) * 24 + 12: LCDBut(i, 4) = y + 44 LCDButton 1, x, y, msg$ Else LCDBut(i, 3) = x1 : LCDBut(i, 4) = y1 EndIf End Sub ' returns the button number that has been pressed or zero if no buton pressed ' normally this is used like this: On LCDTouch() GoSub msg1, msg2, msg3 ' the button number is the order in which they were set up ' boucle de controle des boutons Function LCDTouch Local i, j, k, x, y Print #10, "o" Chr$(4); For k = 1 To 8000 If Loc(10) = 4 Then If Input$(4, #10) = Chr$(0)+Chr$(3)+Chr$(0)+Chr$(0) Then Print #10, "o" Chr$(5); For j = 1 To 8000 If Loc(10) = 4 Then x = Asc(Input$(1, #10)) * 256 + Asc(Input$(1, #10)) y = Asc(Input$(1, #10)) * 256 + Asc(Input$(1, #10)) For i = 1 To 15 If x > LCDBut(i,1) And x < LCDBut(i,3) And y > LCDBut(i,2) And y < LCDBut(i,4) Then If LCDBut(i, 0) = 2 Then LCDBut(i, 0) = 1 If LCDBMsg$(i) <> "" Then LCDButton 0, LCDBut(i, 1), LCDBut(i, 2), LCDBMsg$(i) LCDTouch = i Exit Function EndIf EndIf Next i LCDTouch = 0 Exit Function EndIf Next j Error Else For i = 1 To 15 If LCDBut(i, 0) = 1 Then LCDBut(i, 0) = 2 If LCDBMsg$(i) <> "" Then LCDButton 1, LCDBut(i, 1), LCDBut(i, 2), LCDBMsg$(i) EndIf Next i LCDTouch = 0 Exit Function EndIf EndIf Next k Error "LCD is not responding***" End Function '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''' ' internal routines - user code should not call these routines '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''' ' used internally to draw a button ' user code should not call this sub Sub LCDButton state, x, y, msg$, f, ct, cb Local scale If f = 0 Then f = 23 scale = f\10 If scale = 0 Then scale = 1 f = f Mod 10 If ct = 0 Then ct = RGB(1,1,1) If cb = 0 Then cb = RGB(0,0.5,0.5) Print #10, "O" Chr$(0); : LCDGetAck Print #10, "b" Chr$(state) LCDWords$(3, x, y, cb); Print #10, Chr$(f) LCDWords$(1, ct) Chr$(scale) Chr$(scale); Print #10, msg$ Chr$(0); LCDGetAck End Sub ' used to get an acknowledgement from the LCD ' user code should not call this sub Sub LCDGetAck Local i For i = 1 To 8000 x$ = Input$(1, #10) If x$ = Chr$(6) Then Exit Sub If x$ = Chr$(15) Then Error "LCD reported an error" Next i Error "LCD is not responding ack " End Sub ' send a series of bytes to the screen ' user code should not call this sub Function LCDWords$(nbr, w1, w2, w3, w4, w5) LCDWords$ = Chr$(w1\256) + Chr$(w1 And 255) If nbr > 1 Then LCDWords$ = LCDWords$ + Chr$(w2\256) + Chr$(w2 And 255) If nbr > 2 Then LCDWords$ = LCDWords$ + Chr$(w3\256) + Chr$(w3 And 255) If nbr > 3 Then LCDWords$ = LCDWords$ + Chr$(w4\256) + Chr$(w4 And 255) If nbr > 4 Then LCDWords$ = LCDWords$ + Chr$(w5\256) + Chr$(w5 And 255) End Function a bientot thierry |
||||
TC 72 Newbie Joined: 05/02/2014 Location: FrancePosts: 15 |
hello as I said above I have problem of acquisition speed button. I tried to change the speed of transfers between the display and the card but I did not arrive no result. I first contact at 9600 baud ("u" command) then I wrote Print # 10, "Q" Chr $ (13) (cahangement speed at 115200 LCDGetAck Close # 10 Open "com4: 115200" As # 10 so if Mr. GEOFF GRAHAM reads this line can be can he provided some solutions. may be I am wrong in trying to change the exchange rate between screen and map, loss of time can be elsewhere. thank you and see you soon thierry |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3814 |
No idea what you're asking or what your problem is as I cannot understand you. But I think you need delimitters e.g. not Print # 10, "Q" Chr$(13) but Print # 10, "Q";Chr$(13) What it does without a ";" I don't know. A syntax error would be my choice! John |
||||
TC 72 Newbie Joined: 05/02/2014 Location: FrancePosts: 15 |
hello john thank you for a few moments to read price my request. if you read the source code listed on another post you will notice that mr Geoff Graham wrote the comande to the display without delimiter. Print # 10, "Y" Chr $ (5) Chr $ (0) 'enable the touchscreen LCDGetAck 'Following he is only needed if the display is in portrait mode Print # 10, "Y" Chr $ (4) $ Chr (1) 'rotate screen to landscape to portrait LCDGetAck I are therefore merely copying what have already been doing by changing only the commands. for more information you must know the order of the display 4dsystem kind μlcd 32 PT. thank you to you john. has soon thierry |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3196 |
Thierry, I cannot help you write your programs, especially if I cannot understand what you want. That code is a demo and it worked fine as it was, if you want to adapt it to do something else then you are welcome - but you need to do it yourself. Geoff Geoff Graham - http://geoffg.net |
||||
TC 72 Newbie Joined: 05/02/2014 Location: FrancePosts: 15 |
good evening thank you for your note I do not demand that you do the program my place, the specifications will be too long. I appeal to your service because I know you know the display, and these control codes. I turn around for a few days because I did not manage to change the speed of the serial line on the display. why change the speed? because Touchscreen put 1- 1.5 second to play keys!!. and over the last touches draw works in "autorepet" and I do not understand why. I learn every day by reading on forums or basic old book. but there are things I do not understand. if you want to help me ... thank you in advance. but thank you for this kind of demo program that helps a lot. has soon thierry |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3196 |
The Picasso chip is very slow anyway and that might be part of your problem with speed. I don't have the display set up so I cannot test anything but, from memory, you change the speed of the serial interface using the Set new Baud Rate (51hex) command. For example: Print #10, "Q" Chr$(13); ' change the Picasso interface to 115200 LCDGetAck ' wait for the acknowledgement Close #10 Pause 500 Open "COM4:115200" As #10 ' re open the serial interface at the new speed This assumes that you are using the Duinomite which has a hardware UART on COM4:. I am not in a position to help you much because I do not have a test setup and it was a long time ago when I wrote that demo code. Geoff Geoff Graham - http://geoffg.net |
||||
TC 72 Newbie Joined: 05/02/2014 Location: FrancePosts: 15 |
hello geoff thank you for that information, I think what I wrote was ok except the break that I did not bet. I'll try this. other questions: there t there a way to empty the buffer reception without close command? how t on the "loadlibrary" command uses? Have you an example INCORPORATING order? see you soon and thank you for all thierry |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3196 |
> there t there a way to empty the buffer reception without close command? Yes, use this: DO WHILE INPUT$(250, #10) <> "" : LOOP > how t on the "loadlibrary" command uses? Have you an example INCORPORATING order? I don't know of any examples. The LIBRARY command is easy to use... does anyone else have an example for Thierry ? Geoff Geoff Graham - http://geoffg.net |
||||
Page 2 of 2 |
Print this page |