1.Blink LED

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

http://www.engineersgarage.com/embedded/raspberry-pi/how-to-blink-led-using-raspberry-pi



In this project the Raspberrypi board is loaded with Ubuntu 

and is remotely accessed using VNC

이 프로젝트에서 the Raspberry Pi 보드는 로드된다. with 우분투로
and is 원격으로 접근된다. 사용하여 VNC를.
The Raspberrypi board is also connected to the internet.
There are 26 connectors which can be taken out from the connector port of the Raspberrypi board.
라즈베리파이 보드는 또한 연결된다. to the 인터넷에.
There are 26개의 커넥터들이있다. which can be 밖으로빠져있는 from the 커넥터 포트로부터 of the 라즈베리파이 보드의.
All the connector pins are taken out using 13*2 pin female connectors 
and at the other end of their wire 26 pin Burg stick male connectors are attached.
The Burg stick male connectors allow each pin out from the Raspberrypi board 
to be plugged into the holes of a breadboard.
모든 커넥터 핀들은 빠져있다. 사용하여 13행 2열 핀 female 커넥터들을
and at the 다른 end of their wire 26 핀 Burg stick male 커넥터들이 붙어있다.
The Burg stick male 커넥터들은 허락한다. 각 핀아웃 from the 라즈베리파이 보트로부터
to be 플러그ed 되도록 into the holes로 of the 보드의.


bcm2835-1.26.tar.gz

▲Library를 사용하기위해서는 위 파일의 압축을 풀고

/home/pi folder. 경로로 이동시킨다.

To use bcm2835.h on IDE, release .gz Zip file at /home/pi

그다음 아래 경로에 맞춰서 한줄씩 Terminal에 입력하면 된다.


cd bcm2835-1.26

Now use the following commands one by one to finish the installation process.

./configure

make

sudo make check

sudo make install

이제 IDE환경에서 header file을 사용할 수 있다.

Once the installation is completed the library can be included as a header file in any C codes as

#include <bcm2835.h>



//---------------------led blinking code---------------------------

#include<bcm2835.h>

#define PIN RPI_GPIO_PI_11

int main()
{
    if (!bcm2835_init()) // initialize the library
    return 1;

bcm2835_gpio_fsel (PIN, BCM2835_GPIO_FSEL_OUTP); // Set the pin to be an output

while (1)
{
    bcm2835_gpio_write(PIN, HIGH); // Turn it on
    bcm2835_delay(500); // wait a bit
    bcm2835_gpio_write(PIN, LOW); // turn it off
    bcm2835_delay(500); // wait a bit
}
    bcm2835_close(); // close the library

return 0;

}

//------------------------------------------ led blinking code --------------------------------------------------//





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)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백