Testing LilyPad Arduino
http://arduino.cc/en/Guide/ArduinoLilyPad
test based on a webpage
http://web.media.mit.edu/~leah/LilyPad/06_rgb.html
instead of using 9,10,11 and 5V pins I use 3,5,6 and 13 pins.
The pins 3,5,6,9,10, and 11 have a function of pwm.
From the test, I conform that the function of pwm is available.
LilyPad + LEDs + Buzzer
I added following cords.
int soundPin=2;
int frequency;
pinMode(soundPin,OUTPUT);
frequency=random(800,3000);
tone(soundPin, frequency,5000);
delay(100);
I did a test of temp. sensor but I do not know whether temp. sensor works properly or not.
Stand alone lilypad
Accelerometer test
instruction
Connect X,Y, and Z of the accelerometer to the analog input 0, 1, and 2 respectively.
Also connect 5V and ground.
int pinX=0;
int pinY=1;
int pinZ=2;
int dataX,dataY,dataZ;
void setup()
{
Serial.begin(9600);
}
void loop()
{
dataX=analogRead(pinX);
dataY=analogRead(pinY);
dataZ=analogRead(pinZ);
Serial.print(dataX);
Serial.print("-");
Serial.print(dataY);
Serial.print("-");
Serial.println(dataZ);
delay(100);
}
0 件のコメント:
コメントを投稿