336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

 

 

Practical Arduino Cool Projects For Open Source Hardware (Technology In Action).pdf

Arduino는 오픈소스를 기반으로한 Physical Computing Platform으로,

AVR을 기반으로한 보드와 소프트웨어를 기반으로한 통합환경 IDE를 제공한다.

 http://arduino.cc/en/Main/Software        (☜ Program Download ....FreeWare)

 

 

 


Arduino Parking Lot (주차장 시스템)

 

(▽원리 = Principle) 

 

 

Each line means... ▽

Negative

Positive

Control

 

Refer to YouTube below...

 

 

 

Arduino-Diecimila-schematic.pdf

 

 

 

 

Coding...

/*ParkingL02.pde
Arduining.com 08 JUL 2012
Code used in the production of the Youtube material.
*/

#include <Servo.h>
Servo myservo;              // create servo object to control a servo

#define ServoM    12        //Connected to the servo motor.
#define Bright    11        //servo library disable PWM on pins 9 and 10.
#define Exit      9         //Pin connected to the EXIT button.
#define In        8         //Pin connected to the IN button.

#define BarLow    177       //Low position of the barrier.
#define BarUp     95        //Up position of the barrier.
#define CAPACITY  8         //Capacity of the parking lot.
#define INTEN     80        //Display intensity %

//Pins conections to segments (cathodes). ........핀들은 연결된다.☞ 7세그먼트 Cathode에.
#define  segA  0
#define  segB  1
#define  segC  2
#define  segD  3
#define  segE  4
#define  segF  5
#define  segG  6

//Array with the segments to represent the decimal numbers (0-9).
byte segments[10] = {
// pgfedcba  <--- segments

//p = 0 <-- 사용하지 않으므로(Unused)


  B00111111, // number 0
  B00000110, // number 1
  B01011011, // number 2
  B01001111, // number 3
  B01100110, // number 4
  B01101101, // number 5
  B01111101, // number 6
  B00000111, // number 7
  B01111111, // number 8
  B01101111  // number 9
};

void setup(){
  myservo.attach(ServoM);          // attaches the servo.

  pinMode(Exit, INPUT);           // set "EXIT" button pin to input
  pinMode(In, INPUT);             // set "IN" button pin to input
  digitalWrite(Exit, HIGH);       // Connect Pull-Up resistor.
  digitalWrite(In, HIGH);         // Connect Pull-Up resistor.
  pinMode(segA,OUTPUT);
  pinMode(segB,OUTPUT);
  pinMode(segC,OUTPUT);
  pinMode(segD,OUTPUT);
  pinMode(segE,OUTPUT);
  pinMode(segF,OUTPUT);
  pinMode(segG,OUTPUT);
  pinMode(Bright,OUTPUT);
  analogWrite(Bright,255*INTEN/100);
  myservo.write(BarLow);          //Barrier in the low position
//  delay(1000);
}

int  Available= 9;                    // Number of places available.

//================================================================ ▽ 이하 메인코드
void loop(){
Display(Available);
if(digitalRead(In)==0)

{
  if(Available != 0){
    Available--;
    myservo.write(BarUp);
    delay(3000);
    myservo.write(BarLow);
    }
  }
if(digitalRead(Exit)==0)
{
  if(Available != CAPACITY){
    Available++;
    myservo.write(BarUp);
    delay(3000);
    myservo.write(BarLow);
    }
  }
}

/*-------------------------------------------------------------------
Put the segments according to the number.
--------------------------------------------------------------------*/
void Display(int number){
byte segs =  ~segments[number];        //"~" is used for commom anode.

digitalWrite(segA, bitRead(segs, 0) );
digitalWrite(segB, bitRead(segs, 1) );
digitalWrite(segC, bitRead(segs, 2) );
digitalWrite(segD, bitRead(segs, 3) );
digitalWrite(segE, bitRead(segs, 4) );
digitalWrite(segF, bitRead(segs, 5) );
digitalWrite(segG, bitRead(segs, 6) );
}

 


 

sketch_jan10a.cpp.hex(△위 coding을 통해 생성된 파일)

 

How to generate Hex File.

http://arduino.cc/forum/index.php/topic,46866.0.html

Hold "Shift"key,

then click the Upload button.

You can find the .hex file in the follwing path.

경로 ▽

C\Documentss and Settings\Administrator\Local Settings\Temp\buildXXXXX.tmp\XXXXX.ccp.hex.

(검색이 안되므로 직접 경로를 찾아갈것)

(이 hex파일을 Proteus의 MCU에 upload한다.)

The windows tempory file is hidden.

 

 


Proteus (Set >> Sheet Size...)

 

작업공간 조절가능 !!!

(You can make your workspace bigger enough.!!!)

 


사용하는 푸품들 (=Using parts)

  • IC1 Atmel ATmega328 MCU
  • C1 0.1 uF ceramic capacitor
  • C2,C3 22 pF ceramic capacitor
  • Q1 16 MHz crystal
  • R1 10k 5% 1/4W resistor
  • R2 330 5% 1/4W resistor
  • LED1 5mm red LED
  • S1 Momentary pushbutton switch
  • SV1 10 pin shielded header or dual row header
  • X1 6 pin Molex KK100 or single row header
  • Not shown
    • Perfboard
    • 28-pin socket
    • Power supply.

     

    .

    .

     


    Bus Wire Usage (How to use Bus Wire in Proteus)

     

    Q: How to use Bus_Wire in Proteus ?

    A: Draw the bus >> Connect the bus and a pin >>Give it a label >> Give another one same lable.

     


    Arduino Simulation with Proteus

    http://www.youspice.com/ys/gettingstartedwithproteus.3sp?pageNum=4

     

    Here is spilt in 6 pages.

    You can find complete guide here.

    1. ATMEGA328P를 찾는다.

    2. Crystal과 Capacitor를 찾는다.

    3. 더블클릭한다. on the Crystal을 & Set the frequency to 16MHz.

    4. Then also set the values of Capacitors.

    5. 최종 완성 회로

    6. Download the software from the Arduino site. & Run it.

    7. After compiling your code, browse the hex file you made.

    8. Upload the hex file on the MCU

       and then select the following settings:

     

     

     

     

    9. 끝!

     


    Refer to both pictures below to figure out what the placement of the pinout.

     

     

    Posted by ElectricShock
    :
    BLOG main image
    잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

    공지사항

    카테고리

    분류 전체보기 (782)
    Programming(=프로그래밍) (3)
    MiDi (2)
    Animation (4)
    Blender (3D Graphic Program.. (10)
    Blendtuts.com (Series) (1)
    Blender 기초 팁들 (2)
    Processing (디지털미디어과) (2)
    Music (1)
    Books in the world (0)
    Communication(CAN, UART, et.. (12)
    MCU Examples (PIC 기반) (7)
    Transistor (1)
    Mikro C Pro (11)
    Mikro Pascal (1)
    Proton IDE (0)
    Robot (0)
    Swift 3D (1)
    Dummies Series (1)
    All about Hacking (0)
    제2 외국어 (1)
    PIC 해외서적들 (3)
    AVR (25)
    PIC (MikroC) (MPLAB) (4)
    Assembly (2)
    ARM (3)
    Arduino (26)
    PSpice (1)
    Proteus ISIS (14)
    CodeVision (2)
    FPGA (15)
    MPLAB (24)
    PCB (the Procedure) (15)
    3D Printer (5)
    PICKIT3 (6)
    Matlab (11)
    RaspBerry PI (15)
    BeagleBone (1)
    Android Studio (17)
    졸업작품 (172)
    Korea History (0)
    Issue(사회) (73)
    Multimeter 리뷰 (1)
    Oscilloscope (1)
    A (34)
    B (19)
    J (6)
    C (32)
    P (12)
    T (37)
    H (12)
    I (12)
    M (44)
    R (5)
    E (5)
    F (2)
    D (9)
    O (2)
    L (7)
    S (9)
    W (2)
    V (6)
    G (14)
    Visual C++ or Visual Studio (2)
    Android App Development (0)

    최근에 올라온 글

    최근에 달린 댓글

    최근에 받은 트랙백