-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fork working with 0x7783 LCD devices #32
Open
AlfredoCubitos
wants to merge
10
commits into
adafruit:master
Choose a base branch
from
AlfredoCubitos:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
328a690
Added 0x7783 device support
AlfredoCubitos 0a6e6f7
Update README.txt
AlfredoCubitos 5bf2aae
Readme changed
AlfredoCubitos 44457de
Examples changed
AlfredoCubitos db0bcfb
Merge branch 'master' of https://github.com/AlfredoCubitos/TFTLCD-Lib…
AlfredoCubitos 5371449
Readme again
AlfredoCubitos 93f7011
new example added
AlfredoCubitos 40d618e
usage calibrate example
AlfredoCubitos 58cc1ee
touchpoints fo 0x7783 devices
AlfredoCubitos 3849344
bugfix line 362
AlfredoCubitos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Touch screen library with X Y and Z (pressure) readings as well | ||
// as oversampling to avoid 'bouncing' | ||
// This demo code returns raw readings, public domain | ||
|
||
/* | ||
* This library is for calibrating your touch screen | ||
*/ | ||
|
||
#include <stdint.h> | ||
#include <Adafruit_GFX.h> | ||
#include <Adafruit_TFTLCD.h> | ||
#include "TouchScreen.h" | ||
|
||
#define YP A2 // must be an analog pin, use "An" notation! | ||
#define XM A3 // must be an analog pin, use "An" notation! | ||
#define YM 8 // can be a digital pin | ||
#define XP 9 // can be a digital pin | ||
|
||
#define LCD_CS A3 | ||
#define LCD_CD A2 | ||
#define LCD_WR A1 | ||
#define LCD_RD A0 | ||
// optional | ||
#define LCD_RESET A4 | ||
|
||
#define BLACK 0x0000 | ||
#define BLUE 0x001F | ||
#define RED 0xF800 | ||
#define GREEN 0x07E0 | ||
#define CYAN 0x07FF | ||
#define MAGENTA 0xF81F | ||
#define YELLOW 0xFFE0 | ||
#define WHITE 0xFFFF | ||
#define BOXSIZE 40 | ||
#define PENRADIUS 3 | ||
|
||
|
||
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); | ||
// For better pressure precision, we need to know the resistance | ||
// between X+ and X- Use any multimeter to read it | ||
// For the one we're using, its 300 ohms across the X plate | ||
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); | ||
|
||
void setup(void) { | ||
Serial.begin(9600); | ||
tft.reset(); | ||
uint16_t identifier = tft.readID(); | ||
tft.begin(identifier); | ||
tft.fillScreen(BLACK); | ||
tft.fillRect(0, 0, BOXSIZE, BOXSIZE, RED); | ||
tft.fillRect(tft.width()-BOXSIZE-1,tft.height()-BOXSIZE-1,BOXSIZE, BOXSIZE,GREEN); | ||
} | ||
|
||
void loop(void) { | ||
// a point object holds x y and z coordinates | ||
TSPoint p = ts.getPoint(); | ||
|
||
// we have some minimum pressure we consider 'valid' | ||
// pressure of 0 means no pressing! | ||
if (p.z > ts.pressureThreshhold) { | ||
Serial.print("X = "); Serial.print(p.x); | ||
Serial.print("\tY = "); Serial.print(p.y); | ||
Serial.print("\tPressure = "); Serial.println(p.z); | ||
} | ||
|
||
delay(100); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in line 362 - else if (id == 0x7783 ) you must specify two equal signs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uuh, of course.
Done.