본문 바로가기
728x90
반응형

아두이노_우노4

아두이노 우노 소스 복붙했는데 안되는 경우 제 기억에 아두이노 실습할 때 멀쩡한 소스인데 안되는 경우가 있었습니다. https://notepad-plus-plus.org/downloads/ 불러오는 중입니다... notepad++라는건데 이 프로그램으로 소스파일을 오픈해보면 소스 앞에 안보이던 기호가 있는 경우가 있습니다. 지우고 저장하면 되던게 기억에 남아있어 올립니다. 2019. 11. 13.
아두이노 우노 - 버튼 누르면 led에 순차적으로 점등 int led1 = 10; int led2 = 11; int led3 = 13; int button = 9; int b_num; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); pinMode(button, INPUT); digitalWrite(led1, true); b_num=1; } void loop() { // put your main code here, to run repeatedly: boolean b_state = digitalRead(button); if(b_state) { if(b_.. 2019. 11. 13.
아두이노 우노 - 버튼 풀다운 도레미 #include #define DURATION 10 int notes[] = { NOTE_E4, NOTE_D4, NOTE_C4 }; int btns[] = { 8, 9, 10 }; int speaker = 4; long b_state; void setup() { // put your setup code here, to run once: for(int i = 0; i < 3; i++) { pinMode(btns[i], INPUT); } pinMode(speaker, OUTPUT); } void loop() { // put your main code here, to run repeatedly: int state = 0; for (int i=0; i 2019. 11. 13.
아두이노 우노 - 가변저항(도레미~미레도) 아두이노는 너무 오래되서 기억이 안납니다. 컴퓨터에 남아있어서 올립니다. #include #define DURATION 10 int notes[] = { NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_A4, NOTE_B4, NOTE_C5}; int var = A3; int speaker = 4; long R; long tonee; void setup() { // put your setup code here, to run once: pinMode(var, INPUT); pinMode(speaker, OUTPUT); } void loop() { // put your main code here, to run repeatedly: R = analogRead(var); .. 2019. 11. 13.
728x90
반응형