<?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: Using strings for LCD?</title>
		<link>http://forums.leaflabs.com/topic.php?id=10445</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:07:38 +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=10445" rel="self" type="application/rss+xml" />

		<item>
			<title>pyrohaz on "Using strings for LCD?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10445#post-23946</link>
			<pubDate>Wed, 27 Mar 2013 15:54:27 +0000</pubDate>
			<dc:creator>pyrohaz</dc:creator>
			<guid isPermaLink="false">23946@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Brilliant! Thank you all for the replies, i'll try each method and see which one fits best (probably the lookup table method). The sole reason I can't just lcd.print the codes is that the lcd has 3 seperate screens, they get cycled through every 3 seconds, lcd.print'ing all the variables would kind of wreck this system so i've got a queue of what is displayed instead.&#60;/p&#62;
&#60;p&#62;Thanks guys!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ventosus on "Using strings for LCD?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10445#post-23945</link>
			<pubDate>Wed, 27 Mar 2013 14:07:50 +0000</pubDate>
			<dc:creator>ventosus</dc:creator>
			<guid isPermaLink="false">23945@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;You could also use a lookup table, gives much &#34;nicer&#34; code, IMHO&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
const char *timbre_lookup [] = {&#60;br /&#62;
 &#34;sine wave&#34;,&#60;br /&#62;
 &#34;square wave&#34;,&#60;br /&#62;
 &#34;sawtooth wave&#34;,&#60;br /&#62;
 ...&#60;br /&#62;
};&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;and then just look your value up in the code&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
char *timbre = timbre_lookup[timbreread];&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mlundinse on "Using strings for LCD?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10445#post-23943</link>
			<pubDate>Wed, 27 Mar 2013 11:35:32 +0000</pubDate>
			<dc:creator>mlundinse</dc:creator>
			<guid isPermaLink="false">23943@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;You can simply declare timbre as a pointer to a char array.&#60;/p&#62;
&#60;p&#62;char * timbre;&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Magnus
&#60;/p&#62;</description>
		</item>
		<item>
			<title>siy on "Using strings for LCD?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10445#post-23942</link>
			<pubDate>Wed, 27 Mar 2013 11:25:49 +0000</pubDate>
			<dc:creator>siy</dc:creator>
			<guid isPermaLink="false">23942@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Variable 'timbre' in your code should be pointer to char, not char.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "Using strings for LCD?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10445#post-23940</link>
			<pubDate>Wed, 27 Mar 2013 11:06:00 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">23940@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Using strings... &#60;/p&#62;
&#60;p&#62;Instead of saving this to a variable, why doing something like lcd.print(&#34;XXXXX wave&#34;); ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pyrohaz on "Using strings for LCD?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10445#post-23938</link>
			<pubDate>Wed, 27 Mar 2013 10:18:49 +0000</pubDate>
			<dc:creator>pyrohaz</dc:creator>
			<guid isPermaLink="false">23938@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hey guys, I wrote a sketch on my arduino using a switch statement to determine what will be written to an LCD, it looks like:&#60;/p&#62;
&#60;p&#62;switch(timbreread){&#60;br /&#62;
  case 0:&#60;br /&#62;
  timbre = &#34;sine wave&#34;;&#60;br /&#62;
  break;&#60;br /&#62;
  case 1:&#60;br /&#62;
  timbre = &#34;square wave&#34;;&#60;br /&#62;
  break;&#60;br /&#62;
  case 2:&#60;br /&#62;
  timbre = &#34;sawtooth wave&#34;;&#60;br /&#62;
  break;&#60;br /&#62;
  case 3:&#60;br /&#62;
  timbre = &#34;triangle wave&#34;;&#60;br /&#62;
  break;&#60;br /&#62;
  case 4:&#60;br /&#62;
  timbre = &#34;random wave 1&#34;;&#60;br /&#62;
  break;&#60;br /&#62;
  case 5:&#60;br /&#62;
  timbre = &#34;random wave 2&#34;;&#60;br /&#62;
  break;&#60;br /&#62;
  case 6:&#60;br /&#62;
  timbre = &#34;random wave 3&#34;;&#60;br /&#62;
  break;&#60;br /&#62;
  }&#60;/p&#62;
&#60;p&#62;The variable timbreread is merely a number between 0 and 6 to select the correct timbre. The value timbre is stored as a String. Since I don't get strings on maple, how can I implement this snippet of code? I've tried using char and it just doesn't seem to work.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Harris
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
