<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Porting Adafruit_TFTLCD to MAPLE</title>
		<link>http://forums.leaflabs.com/topic.php?id=1755</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:07:31 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1755" rel="self" type="application/rss+xml" />

		<item>
			<title>manitou on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-20171</link>
			<pubDate>Wed, 03 Oct 2012 17:39:02 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">20171@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;just standard device.  ran it with both arduino and maple.&#60;br /&#62;
on maple, touchscreen pins&#60;br /&#62;
#define YP 18 // must be an analog pin&#60;br /&#62;
#define XM 17 // must be an analog pin&#60;br /&#62;
#define YM 9 // can be a digital pin&#60;br /&#62;
#define XP 8 // can be a digital pin&#60;/p&#62;
&#60;p&#62;I also measured resistance as suggested&#60;/p&#62;
&#60;p&#62;// For better pressure precision, we need to know the resistance&#60;br /&#62;
// between X+ and X- Use any multimeter to read it&#60;br /&#62;
// For the one we're using, its 300 ohms across the X plate&#60;br /&#62;
  and used 361&#60;br /&#62;
 TouchScreen ts = TouchScreen(XP, YP, XM, YM, 361);&#60;/p&#62;
&#60;p&#62;you also might also try NUMSAMPLES 1 in TouchScreen.cpp&#60;br /&#62;
one sketch liked it at 1 another at 2 ...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sei on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-20168</link>
			<pubDate>Wed, 03 Oct 2012 15:28:42 +0000</pubDate>
			<dc:creator>sei</dc:creator>
			<guid isPermaLink="false">20168@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I checked my Touchshield with an arduino and it works flawlessly.&#60;br /&#62;
But with the maple it just doesn't work. The readings don't change if I touch the screen or not and p.z is always 0.&#60;br /&#62;
Do you have a special version of the touchshield or is it just the standard one ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sei on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-17118</link>
			<pubDate>Thu, 27 Sep 2012 03:09:40 +0000</pubDate>
			<dc:creator>sei</dc:creator>
			<guid isPermaLink="false">17118@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;That's nice :)&#60;/p&#62;
&#60;p&#62;Sadly I can't get it running. I suspect my Touchshield is defect, as I don't get any sane readings from the Touchscreen. So the next thing I'll do is to organize an arduino and test if the shield ist ok.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>manitou on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-14243</link>
			<pubDate>Sat, 15 Sep 2012 11:59:59 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">14243@http://forums.leaflabs.com/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62; Would you mind if i put a link to your github in the wiki instead of the link to the gist ? &#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;No problem, but give it a test flight first ...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sei on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-14187</link>
			<pubDate>Sat, 15 Sep 2012 04:16:42 +0000</pubDate>
			<dc:creator>sei</dc:creator>
			<guid isPermaLink="false">14187@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi manitou,&#60;/p&#62;
&#60;p&#62;That's great ! Thank you very much :)&#60;br /&#62;
Would you mind if i put a link to your github in the wiki instead of the link to the gist ?&#60;br /&#62;
Sadly I could not try your stuff yet, but i'm definitly looking forward to it !  &#60;/p&#62;
&#60;p&#62;@mbolivar &#38;amp; gbulmer: you are welcome :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>manitou on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-13194</link>
			<pubDate>Wed, 05 Sep 2012 15:18:18 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">13194@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I have added touchscreen support to sei's library.  I didn't modify sei's lib, but the github files below are organized to be added to your maple sketchbook libraries/ folder.  Touchscreen support is modification of Arduino version, mainly changing from 10-bit to 12-bit ADC.  Besides the graphicstest example, I added rotationtest, tftpaint, touchscreendemo.  I used sei's pin assignments, and like the Arduino, the touchscreen shares pins with the display.  library files are here&#60;/p&#62;
&#60;p&#62;  &#60;a href=&#34;https://github.com/manitou48/maple-touchscreen-libs&#34; rel=&#34;nofollow&#34;&#62;https://github.com/manitou48/maple-touchscreen-libs&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;sei's implementation is faster (graphicstest) than Arduino.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;test            Arduino    Maple   (time in ms)
testttext           843      323
testlines         15090     8994
testfastlines       979      340&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>mbolivar on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-11097</link>
			<pubDate>Wed, 06 Jun 2012 03:15:57 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">11097@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;sei:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
@mbolivar&#60;br /&#62;
I've just made an entry to the supported Shields page.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-11007</link>
			<pubDate>Thu, 31 May 2012 13:37:41 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">11007@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;sei - thank you for taking the comments as constructive. I'm glad they were helpful.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sei on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-10981</link>
			<pubDate>Wed, 30 May 2012 13:39:47 +0000</pubDate>
			<dc:creator>sei</dc:creator>
			<guid isPermaLink="false">10981@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@gbulmer&#60;/p&#62;
&#60;p&#62;It's been a while since the last time I coded in C, also I think i never really used defines, so thanks for your remark! I definitly learned something :)&#60;/p&#62;
&#60;p&#62;@mikep&#60;/p&#62;
&#60;p&#62;I'll put up a new thread in the next minutes ;)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mikep on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755&amp;page=2#post-10980</link>
			<pubDate>Wed, 30 May 2012 13:01:19 +0000</pubDate>
			<dc:creator>mikep</dc:creator>
			<guid isPermaLink="false">10980@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@sei&#60;/p&#62;
&#60;p&#62;It would be great if you get the ITead display to work, I have one of them laying around there too somewhere :). Would be nice to put it to use.&#60;br /&#62;
Let us know how it goes.&#60;/p&#62;
&#60;p&#62;Mike
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755#post-10969</link>
			<pubDate>Tue, 29 May 2012 16:12:44 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10969@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I had a look at the code at &#60;a href=&#34;https://gist.github.com/2728041&#34; rel=&#34;nofollow&#34;&#62;https://gist.github.com/2728041&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;May I make some comments?&#60;/p&#62;
&#60;p&#62;It contains code which breaks a common C convention.&#60;/p&#62;
&#60;p&#62;A macro definition does not follow C syntax. It is a textual replacement, applied to the C source by the 'pre-processor' before the C compiler proper parses the text.&#60;/p&#62;
&#60;p&#62;A macro definition is terminated by a 'raw' (not escaped) newline, and not a ';'.&#60;br /&#62;
So a macro would normally be defined as, e.g;&#60;br /&#62;
&#60;code&#62;#define  RD_LOW		GPIOC-&#38;gt;regs-&#38;gt;BRR = RD_bit&#60;/code&#62;&#60;br /&#62;
or better still:&#60;br /&#62;
&#60;code&#62;#define  RD_LOW		(GPIOC-&#38;gt;regs-&#38;gt;BRR = RD_bit)&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;(In C, most things are expressions (not statements), so a macro which is within &#60;code&#62;(...)&#60;/code&#62; is handy because the value can be used as part of any expression, including a parameter to a function, or in a control statement like an &#60;code&#62;if&#60;/code&#62;, &#60;code&#62;for&#60;/code&#62;, &#60;code&#62;while&#60;/code&#62;, &#60;code&#62;switch&#60;/code&#62;.)&#60;/p&#62;
&#60;p&#62;Defining a macro with  ';' at the end includes the ';' in the source text that the C compiler parses, every place the macro is used. So&#60;br /&#62;
&#60;code&#62;#define  RD_LOW		GPIOC-&#38;gt;regs-&#38;gt;BRR = RD_bit;&#60;/code&#62;&#60;br /&#62;
would include the text ';' wherever the name RD_LOW is used.&#60;/p&#62;
&#60;p&#62;&#60;strong&#62;Summary&#60;/strong&#62;: As a rule-of-thumb, C programmers don't define macro's (#define ...) with their own ';' statement terminator.&#60;br /&#62;
Where practical, macro replacement text is a normal C expression, with &#60;code&#62;(...)&#60;/code&#62; around it (or a single function call).&#60;br /&#62;
We use the normal statement terminator ';' after each expression in the body of the C code, where the macro is used.&#60;/p&#62;
&#60;p&#62;So macro's don't contain a terminating ';'. An expression-terminating ';' (or separating ',' or other operator) is supplied where the macro is used.&#60;/p&#62;
&#60;p&#62;Examples of macro's which have the extra ';'&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;#define  RD_OUTPUT	gpio_set_mode(GPIOC, RD, GPIO_OUTPUT_PP ); 

#define  RD_LOW		GPIOC-&#38;gt;regs-&#38;gt;BRR = RD_bit;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then it is used:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;// ....
        WR_LOW
	WR_HIGH

	write8(data&#38;amp;0xff);

	WR_LOW
	WR_HIGH&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Their are a bunch of reasons the terminating ';' is not included in the macro. For example:&#60;br /&#62;
a. code does not look like C.  It looks like a language which might use new-line as a statement terminator, which is distracting to a C programmer. It causes me to go read the macro's to see why the code looks un-C-like, which isn't necessary.&#60;br /&#62;
b. syntax-aware tools might get confused by the lack of ';', and using text search tools like grep, may become awkward.&#60;br /&#62;
c. some statements, start to look weird, or become impossible. For example:&#60;br /&#62;
&#60;code&#62;for (RD_LOW,i=0; i&#38;lt;10; i++, WR_HIGH)&#60;/code&#62;&#60;br /&#62;
is a non-starter. Yet, there is no need to constrain the way someone else can write code.&#60;br /&#62;
d. it isn't possible to grab the side-effect of a statement and use it's value in a function call, or within an expression.&#60;br /&#62;
For example, I might want to:&#60;br /&#62;
&#60;code&#62;SerialUSB.print(RD_LOW);&#60;/code&#62;&#60;br /&#62;
but that won't work.&#60;/p&#62;
&#60;p&#62;These are tiny little constraints which are easily avoided by removing the ';' from the macro. When the ';' is removed, the code looks like C, and the macro's can be used in 'normal' expressions as easily as '1'.&#60;/p&#62;
&#60;p&#62;I'd recommend removing the ';' from the macro definitions, e.g.:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;#define  RD_OUTPUT	gpio_set_mode(GPIOC, RD, GPIO_OUTPUT_PP)

#define  RD_LOW		(GPIOC-&#38;gt;regs-&#38;gt;BRR = RD_bit)&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and write the code as:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;//...
        WR_LOW;
	WR_HIGH;

	write8(data&#38;amp;0xff);

	WR_LOW;
	WR_HIGH;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I hope that is helpful.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sei on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755#post-10966</link>
			<pubDate>Tue, 29 May 2012 12:01:53 +0000</pubDate>
			<dc:creator>sei</dc:creator>
			<guid isPermaLink="false">10966@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks for posting your code, I'll definitly have a look at it !
&#60;/p&#62;</description>
		</item>
		<item>
			<title>blackswords on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755#post-10910</link>
			<pubDate>Sun, 27 May 2012 14:46:41 +0000</pubDate>
			<dc:creator>blackswords</dc:creator>
			<guid isPermaLink="false">10910@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I adapted a library to Maple for a similar &#60;a href=&#34;http://www.ebay.com/itm/3-2-TFT-LCD-Module-Display-Touch-Panel-PCB-adapter-/190451748066?pt=LH_DefaultDomain_0&#38;amp;hash=item2c57cf0ce2&#34;&#62;screen&#60;/a&#62;, check it out, it can helps.&#60;/p&#62;
&#60;p&#62;there is the headers : &#60;a href=&#34;http://pastebin.com/CrtbsKrR&#34;&#62;LCD&#60;/a&#62; and &#60;a href=&#34;http://pastebin.com/y2UD6LFP&#34;&#62;ASCIILib&#60;/a&#62;&#60;br /&#62;
and the sources :  &#60;a href=&#34;http://pastebin.com/6yHKTP4X&#34;&#62;LCD&#60;/a&#62; and &#60;a href=&#34;http://pastebin.com/Nb8FD5Hj&#34;&#62;ASCIILib&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I just have some problems with the backlight dimming, I'll fix it later&#60;/p&#62;
&#60;p&#62;All is defined as static so it should be used like this : &#60;/p&#62;
&#60;p&#62;LCD::LCD(); // Init&#60;br /&#62;
LCD::Clear(Black); // Set the all screen black&#60;br /&#62;
LCD::WriteText(10,10,&#34;Hello World&#34;,Green,Black); // Write some text to
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sei on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755#post-10907</link>
			<pubDate>Sun, 27 May 2012 14:25:35 +0000</pubDate>
			<dc:creator>sei</dc:creator>
			<guid isPermaLink="false">10907@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;@mbolivar&#60;br /&#62;
I've just made an entry to the supported Shields page.&#60;/p&#62;
&#60;p&#62;@pici&#60;br /&#62;
That's nice to hear :)&#60;/p&#62;
&#60;p&#62;I also tried to get the touchscreen to work but that seems to be pretty difficult because it shares pins with the TFT. So for now I'll go on with a different project, porting the Itead ITDB02-3.2WD to Maple.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "Porting Adafruit_TFTLCD to MAPLE"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1755#post-10880</link>
			<pubDate>Fri, 25 May 2012 22:21:22 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">10880@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;that's cool! why don't you put it on the &#60;a href=&#34;http://wiki.leaflabs.com&#34;&#62;wiki&#60;/a&#62;?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
