<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>虎子哥的博客</title>
	<atom:link href="http://freegezi.net/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://freegezi.net/blog</link>
	<description>For Flash,IOS,Astronomy</description>
	<lastBuildDate>Mon, 23 Jan 2012 14:48:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>辣椒一号赤道仪的无线控制器</title>
		<link>http://freegezi.net/blog/2012/01/362</link>
		<comments>http://freegezi.net/blog/2012/01/362#comments</comments>
		<pubDate>Mon, 23 Jan 2012 09:50:25 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[天文]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=362</guid>
		<description><![CDATA[写了一个可以调整转速的iphone程序，似乎有点供电不足(查出的原因是外接电源电流过大造成的，现在改用5v移动电源通过USB口供电)，电阻发热量也有点大。 参考资料： iOS设备的Socket通讯 http://freegezi.net/blog/2011/12/325 Arduino驱动四相五线步进电机 http://freegezi.net/blog/2011/12/317 Arduino读写永久数据 http://freegezi.net/blog/2012/01/342]]></description>
			<content:encoded><![CDATA[<p><a href="http://freegezi.net/blog/wp-content/uploads/2012/01/lajiaocontroller.jpg"><img class="alignnone size-full wp-image-363" title="lajiaocontroller" src="http://freegezi.net/blog/wp-content/uploads/2012/01/lajiaocontroller.jpg" alt="" width="560" /></a><br />
写了一个可以调整转速的iphone程序，似乎有点供电不足(查出的原因是外接电源电流过大造成的，现在改用5v移动电源通过USB口供电)，电阻发热量也有点大。<br />
参考资料：<br />
iOS设备的Socket通讯 <a href="http://freegezi.net/blog/2011/12/325" target="_blank">http://freegezi.net/blog/2011/12/325</a><br />
Arduino驱动四相五线步进电机 <a href="http://freegezi.net/blog/2011/12/317" target="_blank">http://freegezi.net/blog/2011/12/317</a><br />
Arduino读写永久数据 <a href="http://freegezi.net/blog/2012/01/342" target="_blank">http://freegezi.net/blog/2012/01/342</a></p>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2012/01/362/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>辣椒一号赤道仪本体制作完工</title>
		<link>http://freegezi.net/blog/2012/01/359</link>
		<comments>http://freegezi.net/blog/2012/01/359#comments</comments>
		<pubDate>Fri, 20 Jan 2012 03:30:00 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[天文]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=359</guid>
		<description><![CDATA[春节期间计划把控制器组装好，程序开发完成。]]></description>
			<content:encoded><![CDATA[<p><img src="http://freegezi.net/blog/wp-content/uploads/2012/01/辣椒一号.jpg" alt="" title="辣椒一号" width="438" height="468" class="alignnone size-full wp-image-360" /><br/><br />
春节期间计划把控制器组装好，程序开发完成。</p>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2012/01/359/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino实现读写永久数据</title>
		<link>http://freegezi.net/blog/2012/01/342</link>
		<comments>http://freegezi.net/blog/2012/01/342#comments</comments>
		<pubDate>Sun, 08 Jan 2012 16:09:06 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=342</guid>
		<description><![CDATA[EEPROM（电可擦写可编程只读存储器）是可用户更改的只读存储器（ROM）——一种掉电后数据不丢失的存储芯片。其可通过高于普通电压的作用来擦除和重编程（重写）。 arduino提供很方便的读写EEPROM的函数。这块Arduino Duemilanove板载只有512bytes，不过存简单数据已经足够了。]]></description>
			<content:encoded><![CDATA[<p>EEPROM（电可擦写可编程只读存储器）是可用户更改的只读存储器（ROM）——一种掉电后数据不丢失的存储芯片。其可通过高于普通电压的作用来擦除和重编程（重写）。<br />
arduino提供很方便的读写EEPROM的函数。这块Arduino Duemilanove板载只有512bytes，不过存简单数据已经足够了。</p>
<pre class="brush: jscript; title: ; notranslate">
#include &lt;EEPROM.h&gt;
int addr = 0;
void setup()
{
  Serial.begin(9600);
}
void loop()
{
  if (Serial.available() &gt; 0) {
    int val = Serial.read();
    EEPROM.write(addr, val);
    Serial.print(&quot;I received: &quot;);
    Serial.println(val);
  }
  int value = EEPROM.read(addr);
  Serial.print(&quot;Value: &quot;);
  Serial.println(value);
  delay(1000);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2012/01/342/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino通过WIFI串口与WIFI设备通讯</title>
		<link>http://freegezi.net/blog/2011/12/340</link>
		<comments>http://freegezi.net/blog/2011/12/340#comments</comments>
		<pubDate>Thu, 15 Dec 2011 13:07:00 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ios应用]]></category>
		<category><![CDATA[ios开发]]></category>
		<category><![CDATA[天文]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=340</guid>
		<description><![CDATA[通过几个晚上的折腾，终于打通了通讯的所有环节。WIFI串口需要3.3V的供电，Arduino上的3.3V供电的时候降压到了2.3V导致WIFI串口无法正常工作。现在用5V串了个2欧的电阻，工作电压稳定在3.5V。 Arduino的接收代码： iPhone端的发送代码：]]></description>
			<content:encoded><![CDATA[<p>通过几个晚上的折腾，终于打通了通讯的所有环节。WIFI串口需要3.3V的供电，Arduino上的3.3V供电的时候降压到了2.3V导致WIFI串口无法正常工作。现在用5V串了个2欧的电阻，工作电压稳定在3.5V。<br />
Arduino的接收代码：</p>
<pre class="brush: jscript; title: ; notranslate">
void setup(){
  Serial.begin(115200);
}
void loop() {
  while(Serial.available()&gt;0){
    Serial.print(Serial.read(),HEX);
  Serial.print(&quot;\r\n&quot;);
  }
  delay(100);
}
</pre>
<p>iPhone端的发送代码：</p>
<pre class="brush: jscript; title: ; notranslate">
AsyncSocket * asyncSocket;
-(void)sendDataToWifi{
    Byte byte[] = {0x7f};
    NSData *adata = [[NSData alloc] initWithBytes:byte length:1];
    [asyncSocket writeData:adata withTimeout:-1 tag:1009];
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2011/12/340/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>穿越东西冲</title>
		<link>http://freegezi.net/blog/2011/12/330</link>
		<comments>http://freegezi.net/blog/2011/12/330#comments</comments>
		<pubDate>Mon, 12 Dec 2011 14:03:36 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[其他]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=330</guid>
		<description><![CDATA[上周六参加了一次南澳东西冲的穿越活动，从东冲出发，全程徒步翻山越岭爬悬崖耗时6个小时有惊无险到达西冲目的地。沿途风景很漂亮，不愧是十大XX海岸线之一啊。虎子哥长时间缺乏运动，导致第二天开始腿脚酸痛。呃。]]></description>
			<content:encoded><![CDATA[<p>上周六参加了一次南澳东西冲的穿越活动，从东冲出发，全程徒步翻山越岭爬悬崖耗时6个小时有惊无险到达西冲目的地。沿途风景很漂亮，不愧是十大XX海岸线之一啊。虎子哥长时间缺乏运动，导致第二天开始腿脚酸痛。呃。<br/><br />
<a href="http://user.qzone.qq.com/78127684/blog/1323698631" target="_blank"><img src="http://freegezi.net/blog/wp-content/uploads/2011/12/1.jpg" alt="" title="1" width="540"  class="alignnone size-full wp-image-331" /></a><br/><br />
<a href="http://user.qzone.qq.com/78127684/blog/1323698631" target="_blank"><img src="http://freegezi.net/blog/wp-content/uploads/2011/12/21.jpg" alt="" title="1" width="540"" class="alignnone size-full wp-image-331" /></a><br/><br />
<a href="http://user.qzone.qq.com/78127684/blog/1323698631" target="_blank"><img src="http://freegezi.net/blog/wp-content/uploads/2011/12/3.jpg" alt="" title="1" width="540" class="alignnone size-full wp-image-331" /></a><br/><br />
<a href="http://user.qzone.qq.com/78127684/blog/1323698631" target="_blank"><img src="http://freegezi.net/blog/wp-content/uploads/2011/12/4.jpg" alt="" title="1" width="540" class="alignnone size-full wp-image-331" /></a><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2011/12/330/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ios设备与WIFI串口模块通讯</title>
		<link>http://freegezi.net/blog/2011/12/325</link>
		<comments>http://freegezi.net/blog/2011/12/325#comments</comments>
		<pubDate>Sun, 11 Dec 2011 12:33:55 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ios应用]]></category>
		<category><![CDATA[ios开发]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=325</guid>
		<description><![CDATA[8月份就入了一块wifi串口模块,打算用它来控制赤道仪.因为工作太忙,一直没有开始研究.趁着看月全食的空隙,花了1天时间开始折腾这个模块. wifi串口模块设置成无线串口模式,ios设备手动输入ip和网关. ios app使用了asyncSocket开源库(https://github.com/robbiehanson/CocoaAsyncSocket)项目需要导入CFNetwork.framework. 这样通过socket就可以发送数据到wifi串口模块,后续工作是让arduino接收来自wifi串口数据并控制电机转速.]]></description>
			<content:encoded><![CDATA[<p>8月份就入了一块wifi串口模块,打算用它来控制赤道仪.因为工作太忙,一直没有开始研究.趁着看月全食的空隙,花了1天时间开始折腾这个模块.<br />
wifi串口模块设置成无线串口模式,ios设备手动输入ip和网关.<br />
ios app使用了asyncSocket开源库(<a href="https://github.com/robbiehanson/CocoaAsyncSocket" target="_blank">https://github.com/robbiehanson/CocoaAsyncSocket</a>)项目需要导入CFNetwork.framework.<br />
这样通过socket就可以发送数据到wifi串口模块,后续工作是让arduino接收来自wifi串口数据并控制电机转速.<br/><br />
<img src="http://freegezi.net/blog/wp-content/uploads/2011/12/wifiserial.jpg" alt="" title="wifiserial" width="460" height="613" class="alignnone size-full wp-image-327" /></p>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2011/12/325/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>沙罗周期No.135 12月10日月全食</title>
		<link>http://freegezi.net/blog/2011/12/321</link>
		<comments>http://freegezi.net/blog/2011/12/321#comments</comments>
		<pubDate>Sat, 10 Dec 2011 15:46:05 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[天文]]></category>
		<category><![CDATA[月食]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=321</guid>
		<description><![CDATA[拍摄参数：ISO400，15秒，D=80mm，f=560mm，Canon EOS 1100D]]></description>
			<content:encoded><![CDATA[<p><a href="http://freegezi.net/blog/wp-content/uploads/2011/12/lunar135_small.jpg"><img src="http://freegezi.net/blog/wp-content/uploads/2011/12/lunar135_small.jpg" alt="" title="lunar135_small" width="560" class="alignnone size-full wp-image-322" /></a><br/>拍摄参数：ISO400，15秒，D=80mm，f=560mm，Canon EOS 1100D</p>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2011/12/321/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Arduino驱动四相五线步进电机</title>
		<link>http://freegezi.net/blog/2011/12/317</link>
		<comments>http://freegezi.net/blog/2011/12/317#comments</comments>
		<pubDate>Thu, 08 Dec 2011 14:02:54 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ULN2003]]></category>
		<category><![CDATA[步进电机]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=317</guid>
		<description><![CDATA[28BYJ48 四相五线步进电机，电压为DC5V—DC12V，这个电机通过减速齿轮1:64减速输出，实际步距角度是5.625度 八拍方式驱动：0x08,0x0c,0x04,0x06,0x02,0x03,0x01,0x09]]></description>
			<content:encoded><![CDATA[<p><img src="http://freegezi.net/blog/wp-content/uploads/2011/12/stepper.jpg" alt="" title="stepper" width="500" height="667" class="alignnone size-full wp-image-318" /><br />
28BYJ48 四相五线步进电机，电压为DC5V—DC12V，这个电机通过减速齿轮1:64减速输出，实际步距角度是5.625度<br />
八拍方式驱动：0x08,0x0c,0x04,0x06,0x02,0x03,0x01,0x09</p>
<pre class="brush: jscript; title: ; notranslate">
int Pin0 = 10;
int Pin1 = 11;
int Pin2 = 12;
int Pin3 = 13;
int _step = 0;
boolean dir = true;//正反转
int stepperSpeed = 5;//电机转速,5ms一步
void setup()
{
  pinMode(Pin0, OUTPUT);
  pinMode(Pin1, OUTPUT);
  pinMode(Pin2, OUTPUT);
  pinMode(Pin3, OUTPUT);
}

void loop()
{
  switch(_step){
    case 0:
      digitalWrite(Pin0, LOW);
      digitalWrite(Pin1, LOW);
      digitalWrite(Pin2, LOW);
      digitalWrite(Pin3, HIGH);
    break;
    case 1:
      digitalWrite(Pin0, LOW);
      digitalWrite(Pin1, LOW);
      digitalWrite(Pin2, HIGH);
      digitalWrite(Pin3, HIGH);
    break;
    case 2:
      digitalWrite(Pin0, LOW);
      digitalWrite(Pin1, LOW);
      digitalWrite(Pin2, HIGH);
      digitalWrite(Pin3, LOW);
    break;
    case 3:
      digitalWrite(Pin0, LOW);
      digitalWrite(Pin1, HIGH);
      digitalWrite(Pin2, HIGH);
      digitalWrite(Pin3, LOW);
    break;
    case 4:
      digitalWrite(Pin0, LOW);
      digitalWrite(Pin1, HIGH);
      digitalWrite(Pin2, LOW);
      digitalWrite(Pin3, LOW);
    break;
    case 5:
      digitalWrite(Pin0, HIGH);
      digitalWrite(Pin1, HIGH);
      digitalWrite(Pin2, LOW);
      digitalWrite(Pin3, LOW);
    break;
      case 6:
      digitalWrite(Pin0, HIGH);
      digitalWrite(Pin1, LOW);
      digitalWrite(Pin2, LOW);
      digitalWrite(Pin3, LOW);
    break;
    case 7:
      digitalWrite(Pin0, HIGH);
      digitalWrite(Pin1, LOW);
      digitalWrite(Pin2, LOW);
      digitalWrite(Pin3, HIGH);
    break;
    default:
      digitalWrite(Pin0, LOW);
      digitalWrite(Pin1, LOW);
      digitalWrite(Pin2, LOW);
      digitalWrite(Pin3, LOW);
    break;
  }
  if(dir){
    _step++;
  }else{
    _step--;
  }
  if(_step&gt;7){
    _step=0;
  }
  if(_step&lt;0){
    _step=7;
  }
  delay(stepperSpeed);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2011/12/317/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino温湿度检测</title>
		<link>http://freegezi.net/blog/2011/12/311</link>
		<comments>http://freegezi.net/blog/2011/12/311#comments</comments>
		<pubDate>Tue, 06 Dec 2011 12:22:01 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[dht11]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=311</guid>
		<description><![CDATA[在淘宝上新入一个arduino板子，tx rx端可以使用RS232逻辑电平。顺便买了个DHT11温湿度传感器。 在Mac OS下安装好1.0正式版的Arduino IDE（http://arduino.cc）,新系统还需要装一下FTDI驱动（http://www.ftdichip.com/Drivers/VCP.htm）。 下面是运行效果图 连线很简单，把传感器的s,+,-连接Arduino板子的s,+,-(analog 0)就好了。 代码如下：]]></description>
			<content:encoded><![CDATA[<p>在淘宝上新入一个arduino板子，tx rx端可以使用RS232逻辑电平。顺便买了个DHT11温湿度传感器。<br />
在Mac OS下安装好1.0正式版的Arduino IDE（<a href="http://arduino.cc" target="_blank">http://arduino.cc</a>）,新系统还需要装一下FTDI驱动（<a href="http://www.ftdichip.com/Drivers/VCP.htm" target="_blank">http://www.ftdichip.com/Drivers/VCP.htm</a>）。<br />
下面是运行效果图<br/><img src="http://freegezi.net/blog/wp-content/uploads/2011/12/1.png" alt="" title="1" width="567" height="321" class="alignnone size-full wp-image-312" /><br/><br />
连线很简单，把传感器的s,+,-连接Arduino板子的s,+,-(analog 0)就好了。<br />
代码如下：</p>
<pre class="brush: jscript; title: ; notranslate">
#define DHT11_PIN 0
byte read_dht11_dat()
{
  byte i = 0;
  byte result=0;
  for(i=0; i&lt; 8; i++) {
    while(!(PINC &amp; _BV(DHT11_PIN)));
    delayMicroseconds(30);
    if(PINC &amp; _BV(DHT11_PIN))
      result |=(1&lt;&lt;(7-i));
    while((PINC &amp; _BV(DHT11_PIN)));
  }
  return result;
}
void setup() {
  DDRC |= _BV(DHT11_PIN);
  PORTC |= _BV(DHT11_PIN);
  Serial.begin(19200);
  Serial.println(&quot;Ready&quot;);
}
void loop() {
  byte dht11_dat[5];
  byte dht11_in;
  byte i;
  PORTC &amp;= ~_BV(DHT11_PIN);
  delay(18);
  PORTC |= _BV(DHT11_PIN);
  delayMicroseconds(40);
  DDRC &amp;= ~_BV(DHT11_PIN);
  delayMicroseconds(40);
  dht11_in = PINC &amp; _BV(DHT11_PIN);
  if(dht11_in){
    Serial.println(&quot;dht11 start condition 1 not met&quot;);
    return;
  }
  delayMicroseconds(80);
  dht11_in = PINC &amp; _BV(DHT11_PIN);
  if(!dht11_in)
  {
    Serial.println(&quot;dht11 start condition 2 not met&quot;);
    return;
  }
  delayMicroseconds(80);
  for (i=0; i&lt;5; i++)
    dht11_dat[i] = read_dht11_dat();
  DDRC |= _BV(DHT11_PIN);
  PORTC |= _BV(DHT11_PIN);
  byte dht11_check_sum = dht11_dat[0]+dht11_dat[1]+dht11_dat[2]+dht11_dat[3];
  if(dht11_dat[4]!= dht11_check_sum)
  {
    Serial.println(&quot;DHT11 checksum error&quot;);
  }
  Serial.print(&quot;Current humdity = &quot;);
  Serial.print(dht11_dat[0], DEC);
  Serial.print(&quot;.&quot;);
  Serial.print(dht11_dat[1], DEC);
  Serial.print(&quot;% &quot;);
  Serial.print(&quot;temperature = &quot;);
  Serial.print(dht11_dat[2], DEC);
  Serial.print(&quot;.&quot;);
  Serial.print(dht11_dat[3], DEC);
  Serial.println(&quot;C &quot;);
  delay(2000);
}
</pre>
<p><img src="http://freegezi.net/blog/wp-content/uploads/2011/12/2.jpg" alt="" title="2" width="540" class="alignnone size-full wp-image-313" /></p>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2011/12/311/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matrix For AS3</title>
		<link>http://freegezi.net/blog/2011/12/309</link>
		<comments>http://freegezi.net/blog/2011/12/309#comments</comments>
		<pubDate>Fri, 02 Dec 2011 05:19:50 +0000</pubDate>
		<dc:creator>indream</dc:creator>
				<category><![CDATA[其他]]></category>

		<guid isPermaLink="false">http://freegezi.net/blog/?p=309</guid>
		<description><![CDATA[http://lab.generalrelativity.org/file/MatrixND.as]]></description>
			<content:encoded><![CDATA[<p>http://lab.generalrelativity.org/file/MatrixND.as</p>
]]></content:encoded>
			<wfw:commentRss>http://freegezi.net/blog/2011/12/309/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

