<?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: I am trying to port a library and need help with a unit conversion.</title>
		<link>http://forums.leaflabs.com/topic.php?id=1366</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:20:51 +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=1366" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "I am trying to port a library and need help with a unit conversion."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1366#post-8290</link>
			<pubDate>Mon, 20 Feb 2012 19:00:44 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">8290@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Cyclegadget - the &#60;code&#62;... #define B00000001 (1) ...&#60;/code&#62; was an old fix which is no longer needed.&#60;/p&#62;
&#60;p&#62;In the past, the C/C++ compiler only supported three ways to write literal binary numbers: base 10, base 8 (0...), and base 16 (0x...).&#60;/p&#62;
&#60;p&#62;Sometimes it is easier to understand what is happening when the number is written in base 2, so those names were created to help make those cases easier to understand.&#60;/p&#62;
&#60;p&#62;Now, GNU's C/C++ compiler supports writing binary numbers using 0b00..., so those old names aren't needed any more.&#60;br /&#62;
IMHO, save yourself effort, and use the binary number.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Cyclegadget on "I am trying to port a library and need help with a unit conversion."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1366#post-8288</link>
			<pubDate>Mon, 20 Feb 2012 17:33:15 +0000</pubDate>
			<dc:creator>Cyclegadget</dc:creator>
			<guid isPermaLink="false">8288@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks bubulindo for the reply.&#60;/p&#62;
&#60;p&#62; The code I have started with is here: &#60;a href=&#34;https://github.com/teabot/McpDigitalPot&#34; rel=&#34;nofollow&#34;&#62;https://github.com/teabot/McpDigitalPot&#60;/a&#62;&#60;/p&#62;
&#60;p&#62; I got it to work with an Arduino Uno.&#60;/p&#62;
&#60;p&#62;I want to take your guys advice about:&#60;br /&#62;
#define B00000000 (0)&#60;br /&#62;
#define B00000001 (1)&#60;br /&#62;
#define B00000010 (1)&#60;br /&#62;
#define B00000100 (1)&#60;/p&#62;
&#60;p&#62;and:&#60;br /&#62;
Still #define in wirish\bit_constants.h &#60;/p&#62;
&#60;p&#62;But I am not sure how or where yet. I have been using the &#34;Compile and Error&#34; method&#34; to step through finding problems with the .h and .cpp files. I have started the quest with fixing data types and later, I will have to fix the spi to hardware spi issue.&#60;/p&#62;
&#60;p&#62; I am trying to at least do my part first before asking for more help. Some of it has not been hard but, I have just started.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bubulindo on "I am trying to port a library and need help with a unit conversion."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1366#post-8284</link>
			<pubDate>Mon, 20 Feb 2012 13:04:50 +0000</pubDate>
			<dc:creator>bubulindo</dc:creator>
			<guid isPermaLink="false">8284@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Still #define in wirish\bit_constants.h
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Cyclegadget on "I am trying to port a library and need help with a unit conversion."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1366#post-8283</link>
			<pubDate>Mon, 20 Feb 2012 12:59:25 +0000</pubDate>
			<dc:creator>Cyclegadget</dc:creator>
			<guid isPermaLink="false">8283@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thank you for the reply and the simple fix. If I am successful, I will share my files.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "I am trying to port a library and need help with a unit conversion."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1366#post-8282</link>
			<pubDate>Mon, 20 Feb 2012 12:55:16 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">8282@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Put a zero, 0, in front of the things that look a bit like numbers.&#60;br /&#62;
So B00001100 becomes 0B00001100.&#60;br /&#62;
I find it easier to read using a lower case 'b', and so would be 0b00001100.&#60;/p&#62;
&#60;p&#62;If you have *all* of the code available, I think it will compile correctly anyway. I think it used to be there was a set of defined names, e.g.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;#define B00000000 (0)
#define B00000001 (1)
#define B00000010 (1)
#define B00000100 (1)&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;but it might be an &#60;code&#62;enum&#60;/code&#62; or &#60;code&#62;const&#60;/code&#62;'s now.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Cyclegadget on "I am trying to port a library and need help with a unit conversion."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1366#post-8279</link>
			<pubDate>Mon, 20 Feb 2012 12:34:49 +0000</pubDate>
			<dc:creator>Cyclegadget</dc:creator>
			<guid isPermaLink="false">8279@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I am trying to port the MCP2451 spi digital pot to the maple. I am using Notepad++ to edit my .h and .cpp files. I am gradually getting closer. I have got to this piece of code in the .h and I am not sure what the proper way is to convert these commands. I think it may need to be specified as Hex but, I am not sure. I just need to change the B00000000 parts.&#60;/p&#62;
&#60;p&#62;Please help,&#60;br /&#62;
Mark&#60;/p&#62;
&#60;p&#62;( const static uint8 kADR_WIPER0       = B00000000;&#60;br /&#62;
    const static uint8 kADR_WIPER1       = B00010000;&#60;/p&#62;
&#60;p&#62;    const static uint8 kCMD_READ         = B00001100;&#60;br /&#62;
    const static uint8 kCMD_WRITE        = B00000000;&#60;/p&#62;
&#60;p&#62;    const static uint8 kADR_VOLATILE     = B00000000;&#60;br /&#62;
    const static uint8 kADR_NON_VOLATILE = B00100000;&#60;/p&#62;
&#60;p&#62;    const static uint8 kTCON_REGISTER    = B01000000;&#60;br /&#62;
    const static uint8 kSTATUS_REGISTER  = B01010000;)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
