Go Down

Topic: New TFT Extension Library (Read 12 times) previous topic - next topic

HazardsMind

@cyclegadget
Yea, I can make that, in fact I think I already did, but I didn't make it into a library function.

I will add it to the list.

HazardsMind

#31
Apr 28, 2014, 06:59 pm Last Edit: Apr 29, 2014, 04:34 am by HazardsMind Reason: 1
UPDATE:

Functions added:
   rounded_Square   :: robtillaart
   drawMoon              :: robtillaart
   smiley_Face          :: robtillaart
   HourGlass               :: robtillaart
   SpeechBubble        :: robtillaart

   drawGauge             :: cyclegadget

My own new functions:
  Triangle : Bare basic make-a-triangle function
  fillPoly : Basically a fill triangle function
  drawOvalArc : See the example sketch, MoonLightPark
----------------------------------------------------

I moved the variable Thickness next to radius in both TouchArc and drawArc.
Polygon and drawStar now are able to be filled

And I am still working on making the SpeechBubble have multiple lines of text.

If anyone has anymore ideas for functions they would like to add to the library, let me know and I will add them.

**Currently working on the Greek Font and symbols.

HazardsMind

#32
Apr 29, 2014, 05:13 am Last Edit: Apr 30, 2014, 08:08 am by HazardsMind Reason: 1
Apparently there was an issue with my ConnectFour game that I was unaware of. Here is the fixed version.
Sorry about that.

Added: I decided to make a Bluetooth chat sketch, with a decent looking keyboard and functionality, and so far the results are very promising. Right now it has all the lower case keys plus a working shift key which capitalizes the keys and stores them into a buffer array. I will add all the symbols [~!@#$%^&*()_+] too, but no F1 - F12 keys.

!!! The keyboard is done and working, and it is a new library function. : }

HazardsMind

#33
Apr 30, 2014, 10:33 pm Last Edit: May 04, 2014, 07:13 am by HazardsMind Reason: 1
UPDATE

Keyboard functions and example sketch.

I tested the keyboard functions with RealTerm and works for portrait and landscape modes.
I may make it look better in appearance in the future, but that's for another time.

Enjoy.

ADDED: GreekFont. Drop inside UTFT folder
**If you look at the GreekFont's .c file and you see almost everything as ?, don't worry, it does the exact same thing on my end. For whatever reason, neither wordpad, notepad++, or MSword want to display the Greek symbols upon file entry. Sorry.

HazardsMind

#34
May 07, 2014, 04:53 am Last Edit: May 07, 2014, 09:16 pm by HazardsMind Reason: 1
Update for my Connect Four game!

Players can now play over Bluetooth, and the computer's diagonal block now works correctly. Also I made it so that the computer tries to win, thanks to the AISmartResponse function; The computer is now a rather good opponent.

The only thing I might add now, is a difficult setting and maybe some animations (show piece falling down into place instead of just appearing in place and have the pieces empty out of jig at the bottom).

Im thinking of new games to make, maybe Tetris  :D

I didn't realize, the game was not attached, my bad.

HazardsMind

#35
May 10, 2014, 03:38 am Last Edit: May 11, 2014, 01:23 am by HazardsMind Reason: 1
Slight update with Keyboard functions. New Font added!

Put new font into UTFT folder.

Game: Don't Block Me, is now able to be played in both landscape and portrait modes.
Just change this line #define Orientation LANDSCAPE to either LANDSCAPE or PORTRAIT, then upload to arduino.

Added:
Game: Connect_Four, now has falling animation and fixed "Host/Guest screen"

cyclegadget

HazardsMind,
Thank you for all of your hard work! I tried your "Analog Gauge" example and a couple others but, I had problems compiling them. Here is the error message below for the Gauge example. Can you help fix it?

Code: [Select]
Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Build options changed, rebuilding all

C:\Users\name\Documents\Arduino\libraries\UTFT/UTFT.h: In member function 'void TFT_Extension::makeKeyboard()':
C:\Users\name\Documents\Arduino\libraries\UTFT/UTFT.h:171: error: 'void UTFT::printChar(byte, int, int)' is protected
C:\Users\name\Documents\Arduino\libraries\TFT_Extension\TFT_Extension.cpp:1914: error: within this context
C:\Users\name\Documents\Arduino\libraries\UTFT/UTFT.h: In member function 'void TFT_Extension::makeShiftKeys()':
C:\Users\name\Documents\Arduino\libraries\UTFT/UTFT.h:171: error: 'void UTFT::printChar(byte, int, int)' is protected
C:\Users\name\Documents\Arduino\libraries\TFT_Extension\TFT_Extension.cpp:1935: error: within this context
C:\Users\name\Documents\Arduino\libraries\UTFT/UTFT.h: In member function 'void TFT_Extension::makeCapsKeys()':
C:\Users\name\Documents\Arduino\libraries\UTFT/UTFT.h:171: error: 'void UTFT::printChar(byte, int, int)' is protected
C:\Users\name\Documents\Arduino\libraries\TFT_Extension\TFT_Extension.cpp:1950: error: within this context

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

HazardsMind

#37
May 11, 2014, 06:44 am Last Edit: May 11, 2014, 06:45 am by HazardsMind Reason: 1
I think you need to update your UTFT library. void printChar(byte c, int x, int y); should be under public: in the UTFT.h file but yours is saying it is under protected:

If you want, you can simply move the printChar function under the public access functions, save it, then it should work after that.

cyclegadget

  Thank you HazardsMind! I updated my UTFT library provided by Henning Karlson, and that fixed my problems with compiling your examples.

  Something that my be helpful for other people using your examples would be this bit of commenting, and code that was provided with the UTFT library.

Code: [Select]
// Uncomment the next two lines for the Arduino 2009/UNO
//UTFT        myGLCD(ITDB24D,19,18,17,16);   // Remember to change the model parameter to suit your display module!
//UTouch      myTouch(15,10,14,9,8);

// Uncomment the next two lines for the Arduino Mega
UTFT        myGLCD(ITDB32S, 38,39,40,41);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch(6,5,4,3,2);


Thank you for your work! It will really help me make some nice display screens!

HazardsMind

#39
May 11, 2014, 11:37 pm Last Edit: May 12, 2014, 02:38 am by HazardsMind Reason: 1
I will include those. I also need to point out that some TFT LCD you buy online may appear to have the proper UTFT and Touch libraries, but in fact they are usually modified versions(fake) made for that particular TFT display. Mine just so happens to be one of those fake displays, so I am unable to use the real UTFT library, unless I buy a new display.

But never the less I found a way around that and made this library that works for both types of displays.

HazardsMind

#40
May 12, 2014, 07:56 pm Last Edit: May 12, 2014, 08:35 pm by HazardsMind Reason: 1
New game: Missile Bomber

Objective: destroy the incoming missiles and do NOT let them fall to the ground. Each missile is enough to wipe out an entire city, and if all 20 cities are destroyed, game over.

To destroy a missile, touch the center of them. 5 points for blowing up a missile, and 50 points triggers an additional missile. (6 max)

(Please keep in mind that an Arduino is not meant to display fast moving objects, so it will slow down.)

If anyone has a Due, let me know if it is any better. A small video would be helpful.

gromgsxr

this is really help full for the draw gauge  function thanks, is it possible to to draw more than one gauge?

HazardsMind

I could make it so you could have more than one guage, let me modify the library.

gromgsxr

#43
May 18, 2014, 12:16 am Last Edit: May 18, 2014, 12:41 am by gromgsxr Reason: 1
if you wouldn't mind doing that that would be fantastic.

edit: also the HorSlider and VertSlider functions can they be used as a display?  for instance analogRead(A0) map the values from 0-100 then use those as a display?

HazardsMind

#44
May 18, 2014, 12:56 am Last Edit: May 18, 2014, 02:05 am by HazardsMind Reason: 1
Quote
edit: also the HorSlider and VertSlider functions can they be used as a display?  for instance analogRead(A0) map the values from 0-100 then use those as a display?

? What kind of display? They return 0-100 as a percent, so what else do you have in mind?

Updated library with new Gauges (10 Max)

Also all _Draw functions, (TouchButton_Draw, LatchCircle_Draw, TouchTriangle_Draw. . . etc) are now able to have centered text, they don't limit the text to the size of the "button", sorry too much code for that.
See the Latching_Buttons example.

Question for everyone else.
The library is kinda getting out of hand with all the structs, so if anyone has a better alternative, please share it. At first I was thinking of making everything into individual classes, but then everyone would need to drastically modify there sketches to use them. So if anyone has any ideas, please share and I will see what I can do.

Go Up