목록Arduino (21)
printf("ho_tari\n");
#include Servo myservo; #define ir_enter 2 #define ir_back 3 #define ir_car1 5 #define ir_car2 6 #define ir_car3 7 #define ir_car4 8 #define redPin1 9 #define greenPin1 10 #define bluePin1 A3 #define redPin2 11 #define greenPin2 12 #define bluePin2 A3 #define redPin3 13 #define greenPin3 A0 #define bluePin3 A3 #define redPin4 A2 #define greenPin4 A1 #define bluePin4 A3 #define buzzerPin A4 int f..
#include "PinChangeInterrupt.h" const int LED[6] = {8, 9, 10, 11, 12, 13}; const int SW_0 = 4; int cnt = 0; void SW_0_Pressed(void) { cnt++; } void setup() { // put your setup code here, to run once: for(int i = 0; i < 6; i++) { pinMode(LED[i], OUTPUT); } attachPCINT(digitalPinToPCINT(SW_0), SW_0_Pressed, RISING); } void loop() { // put your main code here, to run repeatedly: for(int i = 0; i < ..
#define STOP 0 #define CW 1 #define CCW 2 const int DC_E = 3; const int DC_P = 5; const int DC_N = 4; void setup() { // put your setup code here, to run once: pinMode(DC_E, OUTPUT); pinMode(DC_P, OUTPUT); pinMode(DC_N, OUTPUT); DC_MOTOR_cntl(CW, 1000); DC_MOTOR_cntl(STOP, 1000); DC_MOTOR_cntl(CCW, 1000); DC_MOTOR_cntl(STOP, 1000); } void loop() { // put your main code here, to run repeatedly: } ..
const int LED[6] = {3, 5, 6, 9, 10, 11}; int cnt = 0; void setup() { // put your setup code here, to run once: for(int i = 0; i < 6; i++) { pinMode(LED[i], OUTPUT); } } void loop() { // put your main code here, to run repeatedly: for(int i = 0; i < 6; i++) { digitalWrite(LED[i], cnt & (0x01
unsigned long t1_prev = 0; const unsigned long t1_delay = 1000; unsigned long t2_prev = 0; const unsigned long t2_delay = 500; void setup() { // put your setup code here, to run once: Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: unsigned long t1_now = millis(); if(t1_now - t1_prev >= t1_delay) { t1_prev = t1_now; Serial.println(" t1 "); } unsigned long t2_..
const int ROW[4] = {13, 12, 11, 10}; //OUTPUT const int COL[4] = {9, 8, 7, 6}; //INPUT int colVal[4] = {LOW}; void setup() { // put your setup code here, to run once: for (int i = 0; i < 4; i++) { pinMode(ROW[i], OUTPUT); digitalWrite(ROW[i], LOW); pinMode(COL[i], INPUT); } Serial.begin(115200); } void loop() { // put your main code here, to run repeatedly: for(int i = 0; i < 4; i++) { digitalWr..
//#include #define delayVal 0 unsigned long t1_prev = 0; const unsigned long t1_delay = 1; unsigned long t2_prev = 0; const unsigned long t2_delay = 300; int led_flag = 0; const int LED = 13; const int fnd_digit[6] = {A0, A1, A2, A3, A4, A5}; const int fnd_data[7] = { 2, 3, 4, 5, 6, 7, 8}; // a, b, c, d, e, f, g const int num_0[7] = { 1, 1, 1, 1, 1, 1, 0}; const int num_1[7] = { 0, 1, 1, 0, 0, 0..
const int fnd_data[7] = { 2, 3, 4, 5, 6, 7, 8}; // a, b, c, d, e, f, g const int num_0[7] = { 1, 1, 1, 1, 1, 1, 0}; const int num_1[7] = { 0, 1, 1, 0, 0, 0, 0}; const int num_2[7] = { 1, 1, 0, 1, 1, 0, 1}; const int num_3[7] = { 1, 1, 1, 1, 0, 0, 1}; const int num_4[7] = { 0, 1, 1, 0, 0, 1, 1}; const int num_5[7] = { 1, 0, 1, 1, 0, 1, 1}; const int num_6[7] = { 1, 0, 1, 1, 1, 1, 1}; const int nu..