<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Moving code from Arduino to Raspberry Pi</title>
	<atom:link href="http://www.brokentoaster.com/blog/?feed=rss2&#038;p=1259" rel="self" type="application/rss+xml" />
	<link>http://www.brokentoaster.com/blog/?p=1259</link>
	<description>Open-source hardware and custom design from MP3 players to 3D printing.</description>
	<lastBuildDate>Sun, 28 Apr 2013 09:30:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Nick</title>
		<link>http://www.brokentoaster.com/blog/?p=1259&#038;cpage=1#comment-154</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sun, 28 Apr 2013 09:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.brokentoaster.com/blog/?p=1259#comment-154</guid>
		<description><![CDATA[Hi Schuyler, I have archived my working folder and uploaded it to &lt;a href=&quot;http://www.brokentoaster.com/RasPi/files/WiringPi_nick.tgz&quot; rel=&quot;nofollow&quot;&gt;http://www.brokentoaster.com/RasPi/files/WiringPi_nick.tgz&lt;/a&gt;
I hope this helps, my finished example from this blog post is in the sub directory mlmc_temp. I may have modified some of the other files in the WiringPi Library or other examples.]]></description>
		<content:encoded><![CDATA[<p>Hi Schuyler, I have archived my working folder and uploaded it to <a href="http://www.brokentoaster.com/RasPi/files/WiringPi_nick.tgz" rel="nofollow">http://www.brokentoaster.com/RasPi/files/WiringPi_nick.tgz</a><br />
I hope this helps, my finished example from this blog post is in the sub directory mlmc_temp. I may have modified some of the other files in the WiringPi Library or other examples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Schuyler</title>
		<link>http://www.brokentoaster.com/blog/?p=1259&#038;cpage=1#comment-152</link>
		<dc:creator>Schuyler</dc:creator>
		<pubDate>Fri, 05 Apr 2013 01:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.brokentoaster.com/blog/?p=1259#comment-152</guid>
		<description><![CDATA[Is there any chance you could share your libraries and example code? I am actually currently trying to get thermocouple readings from a MAX6675 to my raspberry pi, and have had no luck so far...]]></description>
		<content:encoded><![CDATA[<p>Is there any chance you could share your libraries and example code? I am actually currently trying to get thermocouple readings from a MAX6675 to my raspberry pi, and have had no luck so far&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.brokentoaster.com/blog/?p=1259&#038;cpage=1#comment-149</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Thu, 05 Jul 2012 16:43:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.brokentoaster.com/blog/?p=1259#comment-149</guid>
		<description><![CDATA[Absolutely. Have a look at the examples at the &lt;a href=&quot;https://projects.drogon.net/raspberry-pi/wiringpi/examples/&quot; rel=&quot;nofollow&quot;&gt;WiringPi examples page&lt;/a&gt;.

You should be able to use the PWM signal on pin 1 provided your happy with a 3.3V output and changing the scale factor from 0-255 to 0-1023.]]></description>
		<content:encoded><![CDATA[<p>Absolutely. Have a look at the examples at the <a href="https://projects.drogon.net/raspberry-pi/wiringpi/examples/" rel="nofollow">WiringPi examples page</a>.</p>
<p>You should be able to use the PWM signal on pin 1 provided your happy with a 3.3V output and changing the scale factor from 0-255 to 0-1023.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cellfreak</title>
		<link>http://www.brokentoaster.com/blog/?p=1259&#038;cpage=1#comment-148</link>
		<dc:creator>cellfreak</dc:creator>
		<pubDate>Thu, 05 Jul 2012 13:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.brokentoaster.com/blog/?p=1259#comment-148</guid>
		<description><![CDATA[Could this code be converted to the Raspberry Pi. Either for a PWM output or a 0-100 pin output to drive an LED for a reef tank.

byte MoonPhase()
{
int m,d,y;
int yy,mm;
long K1,K2,K3,J,V;
byte PWMvalue;
m = month();
d = day();
y = year();
yy = y-((12-m)/10);
mm = m+9;
if (mm&gt;=12) mm -= 12;
K1 = 365.25*(yy+4712);
K2 = 30.6*mm+.5;
K3 = int(int((yy/100)+49)*.75)-38;
J = K1+K2+d+59-K3;
V = (J-2451550.1)/0.29530588853;
V -= int(V/100)*100;
V = abs(V-50);
PWMvalue = 4*abs(50-V); // 5.12=100% 4=~80%
//pinMode(lowATOPin,OUTPUT);
return (PWMvalue*100)/255;
}
 
It returns 0-100.
You can comment the kast line and return PWMvalue for 0-255.]]></description>
		<content:encoded><![CDATA[<p>Could this code be converted to the Raspberry Pi. Either for a PWM output or a 0-100 pin output to drive an LED for a reef tank.</p>
<p>byte MoonPhase()<br />
{<br />
int m,d,y;<br />
int yy,mm;<br />
long K1,K2,K3,J,V;<br />
byte PWMvalue;<br />
m = month();<br />
d = day();<br />
y = year();<br />
yy = y-((12-m)/10);<br />
mm = m+9;<br />
if (mm&gt;=12) mm -= 12;<br />
K1 = 365.25*(yy+4712);<br />
K2 = 30.6*mm+.5;<br />
K3 = int(int((yy/100)+49)*.75)-38;<br />
J = K1+K2+d+59-K3;<br />
V = (J-2451550.1)/0.29530588853;<br />
V -= int(V/100)*100;<br />
V = abs(V-50);<br />
PWMvalue = 4*abs(50-V); // 5.12=100% 4=~80%<br />
//pinMode(lowATOPin,OUTPUT);<br />
return (PWMvalue*100)/255;<br />
}</p>
<p>It returns 0-100.<br />
You can comment the kast line and return PWMvalue for 0-255.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
