일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 이웃한 칸
- 사물인터넷
- 백준
- 코딩독학
- Python
- Reflex
- java정리
- java
- 개인프로젝트
- 코스닥
- 프로그래밍
- SNS
- C++
- 자바독학
- frontend
- 풀스택프레임워크
- 모의 주식
- 코딩테스트
- 프로그래머스
- 자바정리
- backend
- 코딩
- 코테
- 개발
- Project
- 자바
- 프로그램
- 주가예측
- 빅데이터
- 개발자
- Today
- Total
목록Arduino(C,C++) (20)
Creative Code
const int led[6] = {8,9,10,11,12,13}; const int SW_0 = 2; const int SW_1 = 3; int cnt =0; void SW0_Pressed(void) { for (int i = 0; i
const int SW_0 = 2; //스위치를 연결하는 핀은 2번,3번만 가능하다. const int led_0 = 12; int led_flag = 0; // 0 : OFF , 1 : ON void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(SW_0,INPUT); // 스위치 버튼은 사용자가 입력하는 방식이기에 input을 쓴다. pinMode(led_0,OUTPUT); digitalWrite(led_0,LOW); } void loop() { // put your main code here, to run repeatedly: int digitalValue = digitalRead(SW_0); if ..
const int led = 13; void setup(){ Serial.begin(115200); pinMode(led,OUTPUT); } void loop() { if (Serial.available()) { char userInput = Serial.read(); //문자를 입력받는 함수 switch(userInput) { case 'n' : { digitalWrite(led,HIGH); break; } case 'f': { digitalWrite(led,LOW); break; } default : { break; } } } }
#define STOP 0 #define CW 1 #define CCW 2 const int DC_P = 5; const int DC_N = 4; const int DC_E = 3; //사용자 함수 선언 void DC_MOTOR_cnt1(int mode, int time); void setup() { // put your setup code here, to run once: pinMode(DC_P,OUTPUT); pinMode(DC_N,OUTPUT); pinMode(DC_E,OUTPUT); DC_MOTOR_cnt1(CW,1000); // 시계방향으로 1초동안 회전 DC_MOTOR_cnt1(STOP,3000); // 3초동안 정지 DC_MOTOR_cnt1(CCW,1000); // 반시계방향으로 1초동안 회..
int arr[8]; void setup() { // put your setup code here, to run once: for (int i = 0; i
const int LED_0 = 2; // LED 0~7번을 pin 2~9번에 연결 const int LED_1 = 3; const int LED_2 = 4; const int LED_3 = 5; const int LED_4 = 6; const int LED_5 = 7; const int LED_6 = 8; const int LED_7 = 9; void setup() { // put your setup code here, to run once: pinMode(LED_0,OUTPUT); pinMode(LED_1,OUTPUT); pinMode(LED_2,OUTPUT); pinMode(LED_3,OUTPUT); pinMode(LED_4,OUTPUT); pinMode(LED_5,OUTPUT); pinMode(L..