소스코드3 7-Segment void printDigit(int input); byte Pins[] = {9, 8, 3, 4, 5, 7, 6, 2}; byte Digit[] = { 0xFC, // 0 0x60, // 1 0xDA, // 2 0xF2, // 3 0x66, // 4 0xB6, // 5 0xBE, // 6 0xE4, // 7 0xFE, // 8 0xF6, // 9 }; byte read = 0, tmp; void (*func)(byte); void setup(){ Serial.begin(9600); for(int i=0; i 0){ tmp = read; read = Serial.read(); switch(read){ case 'a': case 'A': func = mode1; mode1(true); read = 0; br.. 아두이노 2022. 1. 18. RTC(Real Time Clock) - DS3231 #include #define SCK_PIN 4 #define IO_PIN 3 #define RST_PIN 2 DS1302 rtc(RST_PIN, IO_PIN, SCK_PIN); void setup() { rtc.halt(false); rtc.writeProtect(false); Serial.begin(9600); /* rtc.setDOW(THURSDAY); rtc.setTime(8, 43, 0); rtc.setDate(2, 9, 2021); /**/ } void loop() { Serial.print("It is "); Serial.print(rtc.getDOWStr()); Serial.print(" / "); Serial.print(rtc.getDateStr()); Serial.print(" / ").. 아두이노 2022. 1. 18. 스텝모터(28BYJ-48) 아두이노 2022. 1. 18. 이전 1 다음