踏進互動科技世界 - Arduino.TW

Arduino+ADXL335三軸加速度感測器

dxla

如果你還不知道Arduino是什麼!?

An Introduction to the Arduino from MAKE magazine  on Vimeo.

Make創辦人Dale Dougherty來台灣演講(MAKE Taiwan舉辦)!

 

 

Arduino入門好簡單-語法篇(SerialRead)

 int incomingByte = 0; // for incoming serial data

 
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
 
void loop() {
 
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
 
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}
 

Arduino入門好簡單-語法篇(randNumber)

{chilicode}

long randNumber1;
long randNumber2;
void setup(){
Serial.begin(9600);
randomSeed(analogRead(0));
}
void loop(){
   randNumber1 = random(300);
   Serial.print("Number1 = ");
   Serial.println(randNumber1);
   randNumber2 = random(10, 20);
   Serial.print("Number2 = ");
   Serial.println(randNumber2);
   delay(2000);
}

{/chilicode}

 

子分類