element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#073 – TFT Touchscreen Tic-Tac-Toe Game
  • Blog
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Cypress Kits requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 4 replies
  • Subscribers 14 subscribers
  • Views 274 views
  • Users 0 members are here
Related

PSoC 4 Pioneer Kit Community Project#073 – TFT Touchscreen Tic-Tac-Toe Game

cy.wbz
cy.wbz over 8 years ago

Hello!

 

In this example we are showcasing how to interface to the TFT Touch Shield v2.0 with the PSoC 4 Pioneer Kit. This example provides a simple user interface game to demonstrate a resistive touchscreen application with the PSoC 4. This example uses the dedicated Serial Communication Block (SPI) to communicate with the LCD controller. The project does not require any UDB resources, therefore it can be used with the PSoC 4 (42xx and 41xx families).  In this example we will use the CY8CKit-042 Pioneer kit and the CY8C42xx family.

 

 

Forum Post Attachments:

 

At the bottom of this post we are including the following items:

  • Example Project Zip File
  • Zip File of Images
    • Project Schematic
    • Component Configurations

 

Components Used:

 

The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

  • SPI
  • Mux
  • ADC SAR Sequencer
  • CyPins

 

Firmware Description:

 

The main.c firmware is included in the example project. Please review the commented sections for more details.

 

In yesterday’s example we introduced the users to the TFT Touchscreen shield. In that example we included .h and .c files to help the user draw shapes and sequences on the screen. In this example we will use those same files to draw the game elements on the screen.

 

The game screen is divided into nine boxes, BOX1, BOX2, BOX3, BOX4, BOX5, BOX6, BOX7, BOX8, BOX9. These boxes are used to divide the screen and display the X’s and O’s from the user touches. In the project, the analog pins XP, YP, XN, YN and the 12 bit SAR ADC are used to detect if a touch is detected within a box. Once a touch is detected the corresponding analog voltages are passed to ADC. Depending on the thresholds defined for each and every box the ADC outputs will indicate which box was pressed.

Included in yesterday’s introductory post were two header files that deliver API support for this TFT Touchscreen screen.  The APIs are then called to plot an X or an O by sending instructions to the LCD controller through SPI.

 

 

 

Hardware Connections:

 

In this example the user needs to connect the TFT Touchscreen shield to the PSoC 4 Pioneer kit.

 


 

Test Your Project:

 

Program the Pioneer kit with the example project and connect the hardware. The user will be presented with squares to place an ‘X’ or a ‘O’. The user can touch the screen to indicate where to place the character. If you connect three characters in a row the game will let you know if you have won.

 

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
TFT_shield.zip
6558.Project Images.zip
  • Reply
  • Cancel
  • Cancel

Top Replies

  • Mosher8
    Mosher8 27 days ago +1

    This code shows a Tic Tac Toe strategy on your TFT screen. This game can be played utilizing the physicality of your screen.

  • jkblm
    jkblm over 8 years ago

    Hi Matt,

     

     

     

    I got my TFT Touch Shield V2.0b 7/27/2012 today from Seeed Studio.

     

     

     

    Compiled the code and programmed the CY8CKit-042 (Creator 3.0 and tried Creator 2.2)

     

    Plugged in the TFT Display

     

    Powered up the units.

     

    The tri-color LED flashes blue/white - Display is all white but no TTT.

     

     

     

    I looked at the photo's that you attached and noted the Touch Resource > Pin assignment - the XP and YP were mapped to the wrong ports.

     

     

     

    Do you have an update to your project?

     

    Do you have a HEX file I can load on my board/LCD to see if the Hardware is working?

     

     

     

    Thanks,

     

     

     

    Jeff

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Former Member
    Former Member over 8 years ago

    Can this work with TFT Touch Shield V1.0.  Right now, I only get a white screen.  However the UART is working.

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • boblant
    boblant over 7 years ago

    Dear matt: I am new to PSOC4 and I am working each of the 100 projects in 100 days
    I wanted to try this project but I am unable to load it into PSOC creator work space. All I get is two files. I have not had any issue with the other examples but this one will not load I am thinking that the Zip file is incorrect. Can you help me with a new file or instructions on how to load the program. Thanks Robert

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Mosher8
    Mosher8 27 days ago

    This code shows a Tic Tac Toe strategy on your TFT screen. This game can be played utilizing the physicality of your screen.

    • Cancel
    • Up +1 Down
    • Reply
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube