tag:blogger.com,1999:blog-9120755343492164185.post8204221524014557566..comments2024-01-02T09:50:32.183-06:00Comments on Matthew McMillan: Arduino - Improving refresh rate of a TFT LCD displayMatthew McMillanhttp://www.blogger.com/profile/02359945130001450035noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-9120755343492164185.post-69672660939007830332018-02-24T06:30:46.201-06:002018-02-24T06:30:46.201-06:00can i make this project with uno and tft mcufriend...can i make this project with uno and tft mcufriends shield?<br />because i got same problem with the tftAnonymoushttps://www.blogger.com/profile/12334524879233391331noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-80040326537356433772017-05-27T11:50:41.594-05:002017-05-27T11:50:41.594-05:00That is it, right on.That is it, right on.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-31217536109573741362017-04-06T07:15:47.271-05:002017-04-06T07:15:47.271-05:00nice postnice postlizahttps://www.blogger.com/profile/06035184100892779826noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-36481395603071624822016-02-17T15:52:27.714-06:002016-02-17T15:52:27.714-06:00Im back at it lol.
Serious suspension issues i had...Im back at it lol.<br />Serious suspension issues i had to focus on. Any how first, i must stress, I'm not here "demanding help" so to speak, nor here to correct you in any way. You, are the only person i know, even online, with vss experience, so, here i am. <br /><br />Got everything lined up, got a signal<br />But, speed reports are very sketchy. Sometimes, over 250mph. Seems to only be stable in the 30s. Ford vic. 8000 pulses (from reports online)<br /><br />So, what do you think may be the issue there? MercuryRisinghttps://www.blogger.com/profile/04488528863106468205noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-14009185797904017532015-11-30T09:38:36.144-06:002015-11-30T09:38:36.144-06:00William, I finally got around to trying out your c...William, I finally got around to trying out your code for drawing numbers. Works great! Matthew McMillanhttps://www.blogger.com/profile/02359945130001450035noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-64998748007359468602015-03-11T09:39:24.074-05:002015-03-11T09:39:24.074-05:00Thanks for contributing William! This is great. I&...Thanks for contributing William! This is great. I'll have to try it out soon.Matthew McMillanhttps://www.blogger.com/profile/02359945130001450035noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-7452809688232975372015-03-10T21:30:01.140-05:002015-03-10T21:30:01.140-05:00Here is a better version than I posted earlier, an...Here is a better version than I posted earlier, and might make your numbers look nicer and will still display fast enough to show real time change in speed. Plus with both a foreground and background color option they clear themselves as they change. There is also a link to where I posted it on the Arduino Forum.<br /><br />http://forum.arduino.cc/index.php?topic=307348.0<br /><br />/**********************************************************************************<br /> Routine to Draw Large 7-Segment formated number with Arduino TFT Library<br /> by William Zaggle (Uses TFT Library DrawLine functions).<br /><br /> int n - The number to be displayed<br /> int xLoc = The x location of the upper left corner of the number<br /> int yLoc = The y location of the upper left corner of the number<br /> int cSe = The size of the number. Range 1 to 10 uses Large Shaped Segments.<br /> fC is the foreground color of the number<br /> bC is the background color of the number (prevents having to clear previous space)<br /> nD is the number of digit spaces to occupy (must include space for minus sign for numbers < 0)<br /> nD < 0 Suppresses leading zero<br /> <br /> Sample Use: Fill the screen with a 2-digit number showing current second suppressing leading zero <br /><br /> draw7Number(second(),20,40,10,WHITE, BLACK, -2);<br /><br />**********************************************************************************/<br />void draw7Number(int n, unsigned int xLoc, unsigned int yLoc, char cS, unsigned int fC, unsigned int bC, char nD) {<br /> unsigned int num=abs(n),i,s,t,w,col,h,a,b,si=0,j=1,d=0,S1=cS,S2=5*cS,S3=2*cS,S4=7*cS,x1=(S3/2)+1,x2=(2*S1)+S2+1,y1=yLoc+x1,y3=yLoc+(2*S1)+S4+1;<br /> unsigned int seg[7][3]={{(S3/2)+1,yLoc,1},{x2,y1,0},{x2,y3+x1,0},{x1,(2*y3)-yLoc,1},{0,y3+x1,0},{0,y1,0},{x1,y3,1}};<br /> unsigned char nums[12]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x67,0x00,0x40},c=(c=abs(cS))>10?10:(c<1)?1:c,cnt=(cnt=abs(nD))>10?10:(cnt<1)?1:cnt;<br /> for (xLoc+=cnt*(d=(2*S1)+S2+(2*S3)+2);cnt>0;cnt--){<br /> for (i=(num>9)?num%10:((!cnt)&&(n<0))?11:((nD<0)&&(!num))?10:num,xLoc-=d,num/=10,j=0;j<7;++j){<br /> col=(nums[i]&(1<<j))?fC:bC;s=(2*S1)/S3;<br /> if (seg[j][2])for(w=S2,t=seg[j][1]+S3,h=seg[j][1]+(S3/2),a=xLoc+seg[j][0]+S1,b=seg[j][1];b<h;b++,a-=s,w+=(2*s))Tft.drawHorizontalLine(a,b,w,col);<br /> else for(w=S4,t=xLoc+seg[j][0]+S3,h=xLoc+seg[j][0]+S3/2,b=xLoc+seg[j][0],a=seg[j][1]+S1;b<h;b++,a-=s,w+=(2*s))Tft.drawVerticalLine(b,a,w,col);<br /> for (;b<t;b++,a+=s,w-=(2*s))seg[j][2]?Tft.drawHorizontalLine(a,b,w,col):Tft.drawVerticalLine(b,a,w,col);<br /> }<br /> }<br />}Anonymoushttps://www.blogger.com/profile/04907565836714792484noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-12683782247573749202015-03-01T21:40:49.990-06:002015-03-01T21:40:49.990-06:00I wrote some code to display numbers as seven segm...I wrote some code to display numbers as seven segment digits and draw the numbers with only seven calls to fillRectangle. It was the only way to update the display fast enough to show tenths of a second updates. It uses both a foreground and background color so you don't have to clear the space each time and can blank leading zeros. The size array is documented so you can create more sizes if needed. Maybe this will help others who need faster numbers.<br /><br />[code]<br />//Draws a Seven Segment Number starting at location xoff/yoff with forground color Color and and background color BColor<br />//By William Zaggle<br />void drawNumber(int number,int xLoc,int yLoc,int cSize, int fColor, int bColor, char nDigits)<br />{<br /> unsigned char numbers[11]= {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x67,0x00}; // seven segment number definitions 0-9 plus blank 10<br /> // siz defines the size of number where<br /> // 0 = width of top,center & bottom segments<br /> // 1 = height of top, center & bottom segments and width of side segments<br /> // 2 = top offset of side segments (top center segment always offset 0)<br /> // 3 = height fo side segments (typically taller than center segments are wide)<br /> // 4 = height offset of lower side segments <br /> // 5 = height offset of lower center segment <br /> // 6 = height offset of middle center segment<br /> // 7 = width offset of center segments<br /> // 8 = width offset of right side segments (left side segments always offset 0)<br /> // 9 = width of number including right side space between numbers<br /> unsigned char siz[6][10] = {{3,1,1,5,7,12,6,2,6,11},{6,2,1,10,13,22,10,3,10,17},{8,3,1,13,16,27,14,5,15,23},{10,3,1,15,18,31,15,5,17,25},{12,4,2,17,21,35,18,6,20,29},{15,5,2,20,24,41,21,7,23,35}};<br /> int i=0,j=1,n=1;<br /> char cnt = abs(nDigits); //cnt = number of digits wanted in display<br /> for (i=number;i>9;i/=10,++j) n*=10; //j = number of digits needed to display and n = 10 to the power of j-1<br /> for (;j9;i/=10,++j) n*=10; //j = number of digits needed to display and n = 10 to the power of j-1<br /> for (;j<cnt;++j) n*=10; //bump n & j to meet cnt if smaller (if larger then only most significant cnt numbers are shown)<br /> while (cnt) {<br /> i = int(number/n); // i = number to show<br /> number -= (i*n); // remove i from the front of the number<br /> n = n/10; // prepare next power of 10<br /> --cnt;<br /> if ((nDigits<0) && (i==0)) i = 10; // show blank in place of leading zero if Digits < 0;<br /> // Starting X Y W H Mask<br /> // ------------------ ----------------- ------------- ------------- -------------------- <br /> Tft.fillRectangle(siz[cSize][7]+xLoc, yLoc, siz[cSize][0], siz[cSize][1], (numbers[i] & 1)?fColor:bColor); // top <br /> Tft.fillRectangle(siz[cSize][8]+xLoc, siz[cSize][2]+yLoc, siz[cSize][1], siz[cSize][3], (numbers[i] & 2)?fColor:bColor); // top right <br /> Tft.fillRectangle(siz[cSize][8]+xLoc, siz[cSize][4]+yLoc, siz[cSize][1], siz[cSize][3], (numbers[i] & 4)?fColor:bColor); // bottom right <br /> Tft.fillRectangle(siz[cSize][7]+xLoc, siz[cSize][5]+yLoc, siz[cSize][0], siz[cSize][1], (numbers[i] & 8)?fColor:bColor); // bottom<br /> Tft.fillRectangle( xLoc, siz[cSize][4]+yLoc, siz[cSize][1], siz[cSize][3], (numbers[i] & 16)?fColor:bColor); // bottom left<br /> Tft.fillRectangle( xLoc, siz[cSize][2]+yLoc, siz[cSize][1], siz[cSize][3], (numbers[i] & 32)?fColor:bColor); // top left<br /> Tft.fillRectangle(siz[cSize][7]+xLoc, siz[cSize][6]+yLoc, siz[cSize][0], siz[cSize][1], (numbers[i] & 64)?fColor:bColor); // middle<br /> xLoc += siz[cSize][9]; //space for next number<br /> } <br />}<br /><br /><br />Anonymoushttps://www.blogger.com/profile/04907565836714792484noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-4177831599764866172015-02-02T10:25:35.532-06:002015-02-02T10:25:35.532-06:00I'm sorry but all this work is useless.
You ca...I'm sorry but all this work is useless.<br />You can use the overloaded function tft.setTextColor(ILI_9340_WHITE, ILI_9340_BLACK) where the first parameter is the color of the text, and the second one is the color of the background. Try it :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-22239577338893153802015-01-26T13:43:26.793-06:002015-01-26T13:43:26.793-06:00If you can share your code with me it would be muc...If you can share your code with me it would be much easier to try and understand you problem. Can you post it on gist.github.com?Matthew McMillanhttps://www.blogger.com/profile/02359945130001450035noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-70089622786248044192015-01-26T04:22:33.715-06:002015-01-26T04:22:33.715-06:00Hi Matt
I have Adafruit 2.2 TFT LCD, now I'm ...Hi Matt<br /><br />I have Adafruit 2.2 TFT LCD, now I'm working on my final project, and I have problems in access this LCD. I want to display the sensor readings with the background of each, there are several kinds of sensors with each background. The problem is, how to display the sensor readings with each background in the 'void loop' but not repeat as the 'void setup' (only called once). In my system there are several sub-menus, and each submenu that I want the background is not repeated (like refresh) but still be able to perform the measurement sensor. I hope you can help me...<br /><br />thank youAnonymoushttps://www.blogger.com/profile/06419321249208932151noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-57567653759912521362015-01-24T09:39:34.092-06:002015-01-24T09:39:34.092-06:00Thanks! This is a good tip!Thanks! This is a good tip!Anonymoushttps://www.blogger.com/profile/18362203169495913147noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-38391318439167198842014-08-07T22:16:33.754-05:002014-08-07T22:16:33.754-05:00I have finished the follow up post to this one. Th...I have finished the follow up post to this one. The code is in this post.<br /><br />http://matthewcmcmillan.blogspot.com/2014/08/arduino-tft-lcd-display-refresh-rate-part2.htmlMatthew McMillanhttps://www.blogger.com/profile/02359945130001450035noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-30922386379807962232014-08-06T11:02:56.736-05:002014-08-06T11:02:56.736-05:00Hi, I having been having trouble doing same thing ...Hi, I having been having trouble doing same thing and I was hoping if you could share the code use in updating the digits that changed.<br /><br />ThanksAnonymoushttps://www.blogger.com/profile/08981536712872997409noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-24614005780679565322014-05-14T08:39:51.853-05:002014-05-14T08:39:51.853-05:00That is exactly what I ended up doing. Another tec...That is exactly what I ended up doing. Another technique I used was to only update digits that have changed. This video shows the results of that:<br /><br />https://www.youtube.com/watch?v=oiNKMw5oj2Q<br />Matthew McMillanhttps://www.blogger.com/profile/02359945130001450035noreply@blogger.comtag:blogger.com,1999:blog-9120755343492164185.post-85948924048547272812014-05-13T02:37:54.509-05:002014-05-13T02:37:54.509-05:00You could try writing over the text with the old t...You could try writing over the text with the old text, but in black. <br /><br />int old_millis;<br />tft.setCursor(120, 70);<br />tft.setTextColor(ILI_9340_BLACK);<br />tft.print(old_millis);<br />tft.setCursor(120, 70);<br />tft.setTextColor(ILI_9340_WHITE);<br />old_millis = millis()/1000;<br />tft.print(old_millis);Anonymousnoreply@blogger.com