Difference between revisions of "Lazy Donkey"
From Microduino Wiki
(→Schematic) |
(→Schematic) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
| | | | ||
==Overview== | ==Overview== | ||
− | Mr. donkey is always too lazy to work. Only by | + | Mr. donkey is always too lazy to work. Only by beating the table will get him work. |
[[File: _304_DozingDonkey-stater.jpg|600px|center]] | [[File: _304_DozingDonkey-stater.jpg|600px|center]] | ||
==Schematic== | ==Schematic== | ||
Use Microduino-shake sensor to detect the beat and let the motor lead the donkey to run forward for some distance. For the running speed and duration time, users can set by yourself based on personal needs. | Use Microduino-shake sensor to detect the beat and let the motor lead the donkey to run forward for some distance. For the running speed and duration time, users can set by yourself based on personal needs. | ||
− | [[File: _304_DozingDonkey-sch- | + | [[File: _304_DozingDonkey-sch-En.jpg|600px|center]] |
==Equipment== | ==Equipment== | ||
Line 81: | Line 81: | ||
==Result== | ==Result== | ||
− | + | By beating the table once, Microduino-Shake sensor can detect the vibration and the donkey will move forward accordingly for one second. | |
[[File: _304_DozingDonkey _lego-ok.jpg|600px|center]] | [[File: _304_DozingDonkey _lego-ok.jpg|600px|center]] | ||
Latest revision as of 08:28, 30 October 2015
Language: | English • 中文 |
---|
ContentsOverviewMr. donkey is always too lazy to work. Only by beating the table will get him work. SchematicUse Microduino-shake sensor to detect the beat and let the motor lead the donkey to run forward for some distance. For the running speed and duration time, users can set by yourself based on personal needs. Equipment
Preparation
program should have successfully been uploaded into the CoreUSB. Program description
#define motor_pinB 6 //Motor 1
#define motor_pinA 8 //Motor 1
//#define servo_pinB 5 //Motor 2
//#define servo_pinA 7 //Motor 2
const int vibrationPin = 10; // Shack sensor
adjust to any value from 0 to 255 (recommended value not less than 60, or may be triggering Movies sensor stability).
modify it as needed. void fullForward() {
//digitalWrite(motor_pinB, HIGH);
analogWrite(motor_pinB,255);//0-255
digitalWrite(motor_pinA, LOW);
delay(1000);
} Hardware Buildup
ResultBy beating the table once, Microduino-Shake sensor can detect the vibration and the donkey will move forward accordingly for one second. Video |