在我看来fla同学就是传说中的能工巧匠,把Arduino,Wiring,Xbee shield和各种扩展板一个一个做了出来,这次趁着帮学妹做毕业创作的机会又试用了Arduino mini。使用说明请参看fla同学的原文:Arduino Mini使用手册。更多图片请至Arduino Mini@Flickr
我把Arduino mini 和 USB Adapter凑凑活活放在一个超小的面包板上,为了容纳它们,只把Arduino mini的数字端口D2,D3,D4和模拟端口A1,A2,A3插入了面包板。并组建了一个pushbutton回路发送0或1的数字给flash。如果有两个小面包板,就可以一个分给mini一个分给usb转接板再屁股对屁股的粘在一起,那时侯就真的是mini喽。
而唯一需要容忍的是要插很多线。。。。
以下代码可以用在pushbutton,红外开关等等各类数字输入设备上,相信用1和0两个数字也可以做出超级有趣的作品。 ^_^
/* Basic Digital Read
* ——————
*
* turns on and off a light emitting diode(LED) connected to digital
* pin 13, when pressing a pushbutton attached to pin 7. It illustrates the
* concept of Active-Low, which consists in connecting buttons using a
* 1K to 10K pull-up resistor.
*
* Created 1 December 2005
* copyleft 2005 DojoDave
* http://arduino.berlios.de
*
* Edit by WhaleForest
* http://imlab.cn/whale
* May 2008
*/
int ledPin = 2; // choose the pin for the LED
int inPin = 4; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inPin, INPUT); // declare pushbutton as input
beginSerial(9600); // added by SD: intiate serial communication
}
void loop(){
val = digitalRead(inPin); // read input value
if (val == HIGH) { // check if the input is HIGH (button released)
digitalWrite(ledPin, LOW); // turn LED OFF
Serial.print(val, DEC);
Serial.print(0, BYTE);
}
else {
digitalWrite(ledPin, HIGH); // turn LED ON
Serial.print(val, DEC);
Serial.print(0, BYTE);
}
}


