여기서는 가장 기본적인 예제 Blink.ino 예제를 테스트한다.
앞 강의에서 환경설정이 끝났다면 다음과 같이 시험한다.
간단한 예제를 아두이노 나노 33 IoT에 업로드 해보자. 아두이노 통합개발환경 IDE에서 파일 - 예제 - 01. Basics - Blink.ino 예제를 사용한다. 예제를 불러오고 아두이노에 업로드하여 동작을 확인한다. 아두이노 나노 33 IoT에 'LED_BUILTIN'핀은 D13번 핀이다.
blink.ino 소스코드는 아래와 같다.
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products
modified 8 May 2014 by Scott Fitzgerald modified 2 Sep 2016 by Arturo Guadalupi
modified 8 Sep 2016 by Colby Newman
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Blink
*/
// the setup function runs once when you press reset or power the board
void setup()
{
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
아두이노 입문할 때 시험하는 코드다. 일단 컴파일과 업로드를 완료하면 아래처럼 상태창에 메시지가 표시된다.
스케치는 프로그램 저장 공간 11436 바이트(4%)를 사용. 최대 262144 바이트.
전역 변수는 3508 바이트의 동적 메모리를 사용.
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Apr 19 2019 14:38:48
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.833 seconds
Write 11436 bytes to flash (179 pages)
[========== ] 35% (64/179 pages)
[===================== ] 71% (128/179 pages)
[==============================] 100% (179/179 pages)
done in 0.071 seconds
Verify 11436 bytes of flash with checksum.
Verify successful
done in 0.015 seconds
CPU reset.
신호 단자에서 3.3/0V로 신호가 나오면서 나노 33 IoT의 주황색 LED가 점멸하는 것을 확인한다. 여기까지 확인하였다면 개발 환경을 성공적으로 완료하였다. 축하한다!

'개발자 > Arduino' 카테고리의 다른 글
| ssd1306 Oled 화면 안 나올 때 점검 사항 (0) | 2020.09.29 |
|---|---|
| Arduino nano 33 IoT 특별한 LSM6DS3 Library (0) | 2020.09.25 |
| 고정밀 온도 습도 센서 DHT21 AM2301 Digital Temperature Humidity Sensor (0) | 2020.09.22 |
| nano 33 IoT 보드로 구현한 스마트 가든 예제 (0) | 2020.09.21 |
| 컴퓨터에서 직접 Arduino 제어하는 Firmata 사용법 (3) | 2020.09.17 |
| Arduino Nano 33 IoT - Ultimate Guide (0) | 2020.09.07 |
| 수심 자동 측정 장치 JSN-SR04T (0) | 2020.08.03 |
| 리튬 배터리 충전 모듈 TP4056 사용법 (1) | 2020.07.20 |
취업, 창업의 막막함, 외주 관리, 제품 부재!
당신의 고민은 무엇입니까? 현실과 동떨어진 교육, 실패만 반복하는 외주 계약,
아이디어는 있지만 구현할 기술이 없는 막막함.
우리는 알고 있습니다. 문제의 원인은 '명확한 학습, 실전 경험과 신뢰할 수 있는 기술력의 부재'에서 시작됩니다.
이제 고민을 멈추고, 캐어랩을 만나세요!
코딩(펌웨어), 전자부품과 디지털 회로설계, PCB 설계 제작, 고객(시장/수출) 발굴과 마케팅 전략으로 당신을 지원합니다.
제품 설계의 고수는 성공이 만든 게 아니라 실패가 만듭니다. 아이디어를 양산 가능한 제품으로!
귀사의 제품을 만드세요. 교육과 개발 실적으로 신뢰할 수 있는 파트너를 확보하세요.
캐어랩