Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 3DPrint
- PLA
- ender 3
- Arduino IDE
- Arduino Reference
- 아두이노 소프트웨어
- 아두이노
- 아두이노 문법
- 3d print
- 3D프린트
- 엔더3
- 프린트
- 아두이노 구조
- 필라멘트
- 엔더
- reference
- 3d printer
- 3d
- printer
- 3dprinter
- 3D프린터
- 프린터
- 아두이노 레퍼런스
- ENDER-3
- 3D 프린터
- 아두이노 IDE
- Arduino
- ender3
- 3D 프린트
Archives
- Today
- Total
키위백과의 잡동사니
FUNCTIONS : millis() 본문
설명(Description)
Arduino 보드가 현재 프로그램을 실행한 후 밀리 초를 반환합니다. 이 숫자는 약 50일 후에 0이 됩니다.
문법(Syntax)
time = millis()
파라미터(Parameters)
없음.
반환(Returns)
프로그램 시작 후 ms 수(unsigned long)
예제 코드(Example Code)
이 코드는 Arduino 보드가 시작된 이후 ms(milliseconds)를 읽습니다.
unsigned long time; void setup(){ Serial.begin(9600); } void loop(){ Serial.print("Time: "); time = millis(); Serial.println(time); //prints time since program started delay(1000); // wait a second so as not to send massive amounts of data }
메모 및 주의(Notes and Warnings)
millis()의 반환 값은 unsigned long이므로 프로그래머가 int와 같은 작은 데이터 유형으로 산술을 수행하려고 하면 논리 오류가 발생할 수 있습니다. 또한, signed long 최대값은 unsigned long 최대값의 절반이므로 오류가 발생할 수 있습니다.
'아두이노 > 참조(Reference)' 카테고리의 다른 글
아두이노 참조 번역 중단 (0) | 2019.02.08 |
---|---|
FUNCTIONS : micros() (0) | 2019.02.08 |
FUNCTIONS : delay() (0) | 2018.05.04 |
FUNCTIONS : digitalWrite() (0) | 2018.05.03 |
FUNCTIONS : pinMode() (0) | 2018.05.02 |
Comments