Introduction: Draw





-Arduino 麵包板 x1

-LED燈 x6

-大按鈕 x1

-公對公電線 x15

-黃色電阻 x7

-連接線 x1


Usage - This machine is for people to draw about who should go out to buy food or buy drinks.

Draw is replace with the Arduino LED light. Press the button, the person's name with LED lighting up responsible for buying food or buying drinks. If no LED light up, then nobody should go and buy food and drink. If all of you want to choose a person to buy, you can take another roll.

Motivation - Sometimes when me and my family stay at home, we don't want to buy food and buy drinks, so we want to have a machine that you can take to buy.

-Arduino breadboard x1

-LED light x6

- Large button x1

- Wire x15

- Yellow resistor x7

Step 1: Connect Five LED Circuit (將LED燈的電路接好,接五個)


Step 2: Connect the Button's Circuit (接按鈕的電路)


Step 3: Complete Circuit (pic) 完整電路圖

Step 4: Paste the Code (貼上程式)

#define DEBUG 0
int first = 2;
int second = 3;
int third = 4;
int fourth = 5;
int fifth = 6;
int sixth = 7;
//set all LEDs
int button = 12; //button pin code
int pressed = 0;
void setup() {
  for (int i=first; i<=sixth; i++) {
    pinMode(i, OUTPUT);
  pinMode(button, INPUT);
  #ifdef DEBUG
void buildUpTension() {
  for (int i=first; i<=sixth; i++) {
    if (i!=first) {
      digitalWrite(i-1, LOW);
    digitalWrite(i, HIGH);
  for (int i=sixth; i>=first; i--) {
    if (i!=sixth) {
      digitalWrite(i+1, LOW);
    digitalWrite(i, HIGH);
void showNumber(int number) {
   if (number == 2) {
  digitalWrite(first, HIGH);
  if (number == 3) {
    digitalWrite(second, HIGH);
  if (number == 4) {
    digitalWrite(third, HIGH);    
  if (number == 5) {
    digitalWrite(fourth, HIGH);    
  if (number == 6) {
    digitalWrite(fifth, HIGH);    
  if (number == 7) {
    digitalWrite(sixth, HIGH);    
int throwDice() {
  int randNumber = random(1,7);
  #ifdef DEBUG
  return randNumber;
void loop() {
  pressed = digitalRead(button);
  if (pressed == HIGH) {
    // remove previous number
    int thrownNumber = throwDice();

Step 5: Wrap Up 貼包裝(以下包裝步驟)

Step 6: Take a Paper Bag 步驟1: 拿一個紙袋

Step 7: Cut It in Half 步驟2:將紙袋剪一半

Step 8: Cut a Piece of Paper and Stick It Onto the Paper Bag 步驟3:剪一片紙袋貼上減一半的紙袋

Step 9: Cut a Hole 步驟4:剪一個放連接線的口

Step 10: Place the Breadboard in and Stick the Names on 步驟5:將麵包板放入並貼上名字便完成了

Step 11: Upload the Program and You're Done上傳程式便可使用了

Step 12: Final Product 成品

Step 13: Video 成品影片