Components and supplies
180
5 mm LED: Red
1
Arduino Nano R3
1
Rotary Encoder with Push-Button
1
DS3231MPMB1 Peripheral Module
1
Jumper wires (generic)
1
Slide Switch
Project description
Code
Programme Code
arduino
Upload this code using Arduino Software
1/* 2This is programmed by BMIAK Basnayaka for SETNFIX youtube channel. 3www.setnfix.com 4youtube.com/setnfix 5Date June 6th 2022 6 7*************************************************************************** 8Operation 9Main part of this project is atmega 328 programming IC and it is connected RTC module DS 3231. The RTC module has a battery cell and it can be sored the current time. Therefore, even the device power is down, once the power came the correct time will be displayed. 10Time display using DIY SSDs with LED bulbs. those are powered by NPN transistors (D400). In order to display the time multiplex method is used. 11 12Adjustment 13Just the programme is uploaded, the computer time will be displayed. 14 151. Press one time the rotary encoder to change the minutes : you can up and down the minutes by rotating the rotary encoder. 162. Press one more time the rotary encoder to change the Hours: you can up and down the hours by rotating the rotary encoder. after the 12 noon, it will show 13,14,15 etc up to 23 and the 24 will be displayed as0. 173.Press again to save the time. As press the 3rd time, the seconds will be "00" with saving the time. 1824/12 hour mode 19** You can change the mode from 24 hour to 12 hour by pressing the button switch. 20 21List of Items 22 23Atmega 328p : https://s.click.aliexpress.com/e/_Ar9cvT 24DS3231 RTC module : https://s.click.aliexpress.com/e/_9HuQMt 25D400/2n2222 transistors : https://s.click.aliexpress.com/e/_9jYHU9 26Red LED bulbs : https://s.click.aliexpress.com/e/_A2rVtR 27Rotary Encoder : https://s.click.aliexpress.com/e/_AaU7Kh 28 29The circuit diagram and the codes cab be seen in the youtube posts. 30 31 32*/ 33// modified connexion by niq_ro from http://nicuflorica.blogspot.com 34// dataseet: http://www.tme.eu/ro/Document/dfc2efde2e22005fd28615e298ea2655/KW4-563XSA.pdf 35 36#include <Wire.h> 37#include "RTClib.h" 38RTC_DS3231 rtc; 39int sH; 40int sM; 41byte minutes1 = 0; 42byte hours1 = 0; 43byte minutes = 0; 44byte hours = 0; 45int OldScnd=0; 46 47int digit1 = 3; // 15 48int digit2 = 5;//12 49int digit3 = 6; //11 50int digit4 = 9;//5 51int digit5 = 10; //3 52int digit6 = 11; //2 53 54int segA = 0; //Display pin 18 55int segB = 1; //Display pin 17 56int segC = 2; //Display pin 16 57int segD = 4; //Display pin 14 58int segE = 7; //Display pin 13 59int segF = 8; //Display pin 6 60int segG = 12; //Display pin 4 61 62 63int hPin = A0; 64int segDP = A1; // AM/PM LED 65 66int encoder0PinA = A2; 67int encoder0PinB = A3; 68int encoder0Pos = 0; 69int encoder0PinALast = LOW; 70int n = LOW; 71const int buttonPin = 13; 72// Variables will change: 73int ledState = HIGH; // the current state of the output pin 74int buttonState; // the current reading from the input pin 75int lastButtonState = LOW; // the previous reading from the input pin 76int reading = 0; 77int dUP = 0; 78 79// the following variables are unsigned longs because the time, measured in 80// milliseconds, will quickly become a bigger number than can be stored in an int. 81unsigned long lastDebounceTime = 0; // the last time the output pin was toggled 82unsigned long debounceDelay = 50; // the debounce time; increase if the output flickers 83 84 85int clickPin = 0; 86int clickNow = 0; 87 88/* 89 // Date and time functions using a DS1307 RTC connected via I2C and Wire lib 90 // original sketck from http://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/ 91 // add part with SQW=1Hz from http://tronixstuff.wordpress.com/2010/10/20/tutorial-arduino-and-the-i2c-bus/ 92 // add part with manual adjust http://www.bristolwatch.com/arduino/arduino_ds1307.htm 93 94*/ 95 96// use for hexa in zecimal conversion 97int zh, uh, ore; 98int zm, um, miniti; 99 100void setup() { 101 102 103 { 104 //Serial.begin(9600); 105 delay(3000); // wait for console opening 106 107 if (! rtc.begin()) { 108 Serial.println("Couldn't find RTC"); 109 while (1); 110 } 111 112 if (rtc.lostPower()) { 113 Serial.println("RTC lost power, lets set the time!"); 114 115 // Comment out below lines once you set the date & time. 116 // Following line sets the RTC to the date & time this sketch was compiled 117 rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); 118 119 // Following line sets the RTC with an explicit date & time 120 // for example to set January 27 2017 at 12:56 you would call: 121 //rtc.adjust(DateTime(2017, 1, 27, 12, 56, 0)); 122 } 123 } 124 125 pinMode(segA, OUTPUT); 126 pinMode(segB, OUTPUT); 127 pinMode(segC, OUTPUT); 128 pinMode(segD, OUTPUT); 129 pinMode(segE, OUTPUT); 130 pinMode(segF, OUTPUT); 131 pinMode(segG, OUTPUT); 132 pinMode(segDP, OUTPUT); 133 pinMode(hPin,INPUT_PULLUP); 134 135 pinMode(digit1, OUTPUT); 136 pinMode(digit2, OUTPUT); 137 pinMode(digit3, OUTPUT); 138 pinMode(digit4, OUTPUT); 139 pinMode(digit5, OUTPUT); 140 pinMode(digit6, OUTPUT); 141 pinMode(buttonPin, INPUT_PULLUP); 142 pinMode (encoder0PinA, INPUT); 143 pinMode (encoder0PinB, INPUT); 144 145} 146 147 148 149 150void loop() { 151 152 //DateTime now = Myset.now(); 153 DateTime now = rtc.now(); 154 155 reading = digitalRead(buttonPin); 156 157 if (reading != lastButtonState) { 158 // reset the debouncing timer 159 lastDebounceTime = millis(); 160 } 161 162 if ((millis() - lastDebounceTime) > debounceDelay) { 163 // whatever the reading is at, it's been there for longer than the debounce 164 // delay, so take it as the actual current state: 165 166 // if the button state has changed: 167 if (reading != buttonState) { 168 buttonState = reading; 169 170 // only toggle the LED if the new button state is HIGH 171 if (buttonState == LOW) { 172 clickPin = clickPin + 1; 173 delay(500); 174 } 175 } 176 } 177 178 //if (clickPin > 3) {clickPin =0;} 179 // save the reading. Next time through the loop, it'll be the lastButtonState: 180 lastButtonState = reading; 181 182 if (clickPin==0){//********************************************************* 183 184 DateTime future (now + TimeSpan(0, 0, 0, 0)); 185 186 long timp = future.hour() * 10000UL + future.minute() * 100 + future.second(); 187 Serial.println(" timp : "); 188 Serial.print(timp); 189sM = future.minute(); // load current minute for adjustment 190sH = future.hour(); // load current hours for adjustment 191 192//************************************************************************************* 193//24 details code 194//************************************************************************************* 195 196int hData = digitalRead(hPin); 197if (hData ==0){ 198 199 if (timp > 130000){ 200 timp = timp - 120000; 201 } 202 203} 204 205//************************************************************************************* 206//24 details code END 207//************************************************************************************* 208 209//---------------------------------------------------------------------------- 210 211 for (int i = 10 ; i > 0 ; i--) { 212 if (timp >= 100000) displayNumber01(timp); 213 else displayNumber02(timp); 214 } 215 216 }//********************************************************* 217 218 219 220 221Serial.println(clickPin); 222 223//************************************************************************************* 224// Code for Segment LEDS 225//************************************************************************************* 226int Scnd = now.second(); 227 228if (Scnd != OldScnd){ 229 if (Scnd % 2==0){ 230 digitalWrite(segDP,HIGH);} else{digitalWrite(segDP,LOW);} 231 } 232 233 OldScnd = Scnd; 234 //************************************************************************************* 235 // Code for Segment LEDS END 236 //************************************************************************************* 237 238//************************************************************************************* 239if (clickPin > 0){ // Editing Mode Started--------------------------------------------- 240//************************************************************************************* 241 242n = digitalRead(encoder0PinA); 243 if ((encoder0PinALast == LOW) && (n == HIGH)) { 244 if (digitalRead(encoder0PinB) == LOW) { 245 246 if (clickPin==1){sM = sM-1;delay(5); if (sM < 0)sM =59;delay(5);} 247 if (clickPin==2){sH=sH-1; delay(5);if (sH < 0)sH =23;delay(5);} 248 delay(100); 249 250 } else { 251 252 if (clickPin==1){sM = sM +1;delay(5); if (sM > 59)sM =0; delay(5);} 253 if (clickPin==2){sH=sH+1;delay(5); if (sH > 23)sH =0;delay(5);} 254 delay(100); 255 } 256 } 257encoder0PinALast = n; 258//DateTime now = rtc.now(); 259//Serial.println("H : "); 260//Serial.println(future.hour(),DEC); 261 262long timp = sH * 10000UL + sM *100; 263 264 for (int i = 20 ; i > 0 ; i--) { 265 if (timp >= 100000) displayNumber01(timp); 266 else displayNumber02(timp); 267 } 268 269if (clickPin > 2){ 270 //DateTime future (now + TimeSpan(0, sH, sM, 0)); 271rtc.adjust(DateTime(1985, 4, 7, sH,sM, 0)); 272//rtc.adjust(DateTime(2017, 1, 27, 12, 56, 0)); 273delay(500); 274sH=0; 275sM=0; 276 277 278clickPin=0; // reset the pin after saving time 279 280} 281 282//************************************************************************************* 283 }// Editing Mode END```````````````````````````````````````````````````````````````` 284//************************************************************************************* 285 286 287}//===========================VOID LOOP END============================================== 288 289 290 291 292 293 294 295 296 297void displayNumber01(long toDisplay) { 298#define DISPLAY_BRIGHTNESS 25 299 300#define DIGIT_ON HIGH 301#define DIGIT_OFF LOW 302 303 for (int digit = 6 ; digit > 0 ; digit--) { 304 305 //Turn on a digit for a short amount of time 306 switch (digit) { 307 case 1: 308 digitalWrite(digit1, DIGIT_ON); 309 //digitalWrite(segDP, HIGH); 310 break; 311 case 2: 312 digitalWrite(digit2, DIGIT_ON); 313 //digitalWrite(segDP, LOW); 314 break; 315 case 3: 316 digitalWrite(digit3, DIGIT_ON); 317 //digitalWrite(segDP, HIGH); 318 break; 319 case 4: 320 digitalWrite(digit4, DIGIT_ON); 321 //digitalWrite(segDP, HIGH); 322 break; 323 case 5: 324 digitalWrite(digit5, DIGIT_ON); 325 //digitalWrite(segDP, HIGH); 326 break; 327 case 6: 328 digitalWrite(digit6, DIGIT_ON); 329 //digitalWrite(segDP, HIGH); 330 break; 331 332 } 333 lightNumber(toDisplay % 10); 334 toDisplay /= 10; 335 delayMicroseconds(DISPLAY_BRIGHTNESS); 336 337 //Turn off all segments 338 lightNumber(10); 339 340 //Turn off all digits 341 digitalWrite(digit1, DIGIT_OFF); 342 digitalWrite(digit2, DIGIT_OFF); 343 digitalWrite(digit3, DIGIT_OFF); 344 digitalWrite(digit4, DIGIT_OFF); 345 digitalWrite(digit5, DIGIT_OFF); 346 digitalWrite(digit6, DIGIT_OFF); 347 } 348} 349 350void displayNumber02(long toDisplay) { 351#define DISPLAY_BRIGHTNESS 25 352 353#define DIGIT_ON HIGH 354#define DIGIT_OFF LOW 355 356 for (int digit = 6 ; digit > 0 ; digit--) { 357 358 //Turn on a digit for a short amount of time 359 switch (digit) { 360 case 1: 361 lightNumber(10); 362 //digitalWrite(segDP, HIGH); 363 break; 364 case 2: 365 digitalWrite(digit2, DIGIT_ON); 366 //digitalWrite(segDP, LOW); 367 break; 368 case 3: 369 digitalWrite(digit3, DIGIT_ON); 370 //digitalWrite(segDP, HIGH); 371 break; 372 case 4: 373 digitalWrite(digit4, DIGIT_ON); 374 //digitalWrite(segDP, HIGH); 375 break; 376 case 5: 377 digitalWrite(digit5, DIGIT_ON); 378 //digitalWrite(segDP, HIGH); 379 break; 380 case 6: 381 digitalWrite(digit6, DIGIT_ON); 382 //digitalWrite(segDP, HIGH); 383 break; 384 } 385 lightNumber(toDisplay % 10); 386 toDisplay /= 10; 387 delayMicroseconds(DISPLAY_BRIGHTNESS); 388 389 //Turn off all segments 390 lightNumber(10); 391 392 //Turn off all digits 393 digitalWrite(digit1, DIGIT_OFF); 394 digitalWrite(digit2, DIGIT_OFF); 395 digitalWrite(digit3, DIGIT_OFF); 396 digitalWrite(digit4, DIGIT_OFF); 397 digitalWrite(digit5, DIGIT_OFF); 398 digitalWrite(digit6, DIGIT_OFF); 399 } 400} 401 402void displayNumber03(long toDisplay) { 403#define DISPLAY_BRIGHTNESS 25 404 405#define DIGIT_ON HIGH 406#define DIGIT_OFF LOW 407 408 for (int digit = 6 ; digit > 0 ; digit--) { 409 410 //Turn on a digit for a short amount of time 411 switch (digit) { 412 case 1: 413 digitalWrite(digit1, DIGIT_ON); 414 //digitalWrite(segDP, HIGH); 415 break; 416 case 2: 417 digitalWrite(digit2, DIGIT_ON); 418 //digitalWrite(segDP, HIGH); 419 break; 420 case 3: 421 digitalWrite(digit3, DIGIT_ON); 422 //digitalWrite(segDP, HIGH); 423 break; 424 case 4: 425 digitalWrite(digit4, DIGIT_ON); 426 //digitalWrite(segDP, HIGH); 427 break; 428 case 5: 429 digitalWrite(digit5, DIGIT_ON); 430 //digitalWrite(segDP, HIGH); 431 break; 432 case 6: 433 digitalWrite(digit6, DIGIT_ON); 434 //digitalWrite(segDP, HIGH); 435 break; 436 } 437 lightNumber(toDisplay % 10); 438 toDisplay /= 10; 439 delayMicroseconds(DISPLAY_BRIGHTNESS); 440 441 //Turn off all segments 442 lightNumber(10); 443 444 //Turn off all digits 445 digitalWrite(digit1, DIGIT_OFF); 446 digitalWrite(digit2, DIGIT_OFF); 447 digitalWrite(digit3, DIGIT_OFF); 448 digitalWrite(digit4, DIGIT_OFF); 449 digitalWrite(digit5, DIGIT_OFF); 450 digitalWrite(digit6, DIGIT_OFF); 451 } 452} 453 454void displayNumber04(long toDisplay) { 455#define DISPLAY_BRIGHTNESS 25 456 457#define DIGIT_ON HIGH 458#define DIGIT_OFF LOW 459 460 for (int digit = 4 ; digit > 0 ; digit--) { 461 462 //Turn on a digit for a short amount of time 463 switch (digit) { 464 case 1: 465 lightNumber(10); 466 //digitalWrite(segDP, HIGH); 467 break; 468 case 2: 469 digitalWrite(digit2, DIGIT_ON); 470 //digitalWrite(segDP, HIGH); 471 break; 472 case 3: 473 digitalWrite(digit3, DIGIT_ON); 474 //digitalWrite(segDP, HIGH); 475 break; 476 case 4: 477 digitalWrite(digit4, DIGIT_ON); 478 //digitalWrite(segDP, HIGH); 479 break; 480 case 5: 481 digitalWrite(digit5, DIGIT_ON); 482 //digitalWrite(segDP, HIGH); 483 break; 484 case 6: 485 digitalWrite(digit6, DIGIT_ON); 486 //digitalWrite(segDP, HIGH); 487 break; 488 } 489 lightNumber(toDisplay % 10); 490 toDisplay /= 10; 491 delayMicroseconds(DISPLAY_BRIGHTNESS); 492 493 //Turn off all segments 494 lightNumber(10); 495 496 //Turn off all digits 497 digitalWrite(digit1, DIGIT_OFF); 498 digitalWrite(digit2, DIGIT_OFF); 499 digitalWrite(digit3, DIGIT_OFF); 500 digitalWrite(digit4, DIGIT_OFF); 501 digitalWrite(digit5, DIGIT_OFF); 502 digitalWrite(digit6, DIGIT_OFF); 503 } 504} 505 506void displayNumber05(long toDisplay) { 507#define DISPLAY_BRIGHTNESS 25 508 509#define DIGIT_ON HIGH 510#define DIGIT_OFF LOW 511 512 for (int digit = 6 ; digit > 0 ; digit--) { 513 514 //Turn on a digit for a short amount of time 515 switch (digit) { 516 case 1: 517 digitalWrite(digit1, DIGIT_ON); 518 //digitalWrite(segDP, HIGH); 519 break; 520 case 2: 521 digitalWrite(digit2, DIGIT_ON); 522 //digitalWrite(segDP, HIGH); 523 break; 524 case 3: 525 digitalWrite(digit3, DIGIT_ON); 526 //digitalWrite(segDP, HIGH); 527 break; 528 case 4: 529 digitalWrite(digit4, DIGIT_ON); 530 //digitalWrite(segDP, HIGH); 531 break; 532 case 5: 533 digitalWrite(digit5, DIGIT_ON); 534 //digitalWrite(segDP, HIGH); 535 break; 536 case 6: 537 digitalWrite(digit6, DIGIT_ON); 538 //digitalWrite(segDP, HIGH); 539 break; 540 } 541 lightNumber(toDisplay % 10); 542 toDisplay /= 10; 543 delayMicroseconds(DISPLAY_BRIGHTNESS); 544 545 //Turn off all segments 546 lightNumber(10); 547 548 //Turn off all digits 549 digitalWrite(digit1, DIGIT_OFF); 550 digitalWrite(digit2, DIGIT_OFF); 551 digitalWrite(digit3, DIGIT_OFF); 552 digitalWrite(digit4, DIGIT_OFF); 553 digitalWrite(digit5, DIGIT_OFF); 554 digitalWrite(digit6, DIGIT_OFF); 555 } 556} 557 558void displayNumber06(long toDisplay) { 559#define DISPLAY_BRIGHTNESS 25 560 561#define DIGIT_ON HIGH 562#define DIGIT_OFF LOW 563 564 for (int digit = 6 ; digit > 0 ; digit--) { 565 566 //Turn on a digit for a short amount of time 567 switch (digit) { 568 case 1: 569 digitalWrite(digit1, DIGIT_ON); 570 // //digitalWrite(segDP, HIGH); 571 break; 572 case 2: 573 digitalWrite(digit2, DIGIT_ON); 574 ////digitalWrite(segDP, HIGH); 575 break; 576 case 3: 577 digitalWrite(digit3, DIGIT_ON); 578 ////digitalWrite(segDP, HIGH); 579 break; 580 case 4: 581 digitalWrite(digit4, DIGIT_ON); 582 ////digitalWrite(segDP, HIGH); 583 break; 584 case 5: 585 digitalWrite(digit5, DIGIT_ON); 586 ////digitalWrite(segDP, HIGH); 587 break; 588 case 6: 589 digitalWrite(digit6, DIGIT_ON); 590 ////digitalWrite(segDP, HIGH); 591 break; 592 } 593 lightNumber(toDisplay % 10); 594 toDisplay /= 10; 595 delayMicroseconds(DISPLAY_BRIGHTNESS); 596 597 //Turn off all segments 598 lightNumber(10); 599 600 //Turn off all digits 601 digitalWrite(digit1, DIGIT_OFF); 602 digitalWrite(digit2, DIGIT_OFF); 603 digitalWrite(digit3, DIGIT_OFF); 604 digitalWrite(digit4, DIGIT_OFF); 605 digitalWrite(digit5, DIGIT_OFF); 606 digitalWrite(digit6, DIGIT_OFF); 607 } 608} 609//Given a number, turns on those segments 610//If number == 10, then turn off number 611void lightNumber(int numberToDisplay) { 612 613#define SEGMENT_ON HIGH 614#define SEGMENT_OFF LOW 615 616 switch (numberToDisplay) { 617 618 case 0: 619 digitalWrite(segA, SEGMENT_ON); 620 digitalWrite(segB, SEGMENT_ON); 621 digitalWrite(segC, SEGMENT_ON); 622 digitalWrite(segD, SEGMENT_ON); 623 digitalWrite(segE, SEGMENT_ON); 624 digitalWrite(segF, SEGMENT_ON); 625 digitalWrite(segG, SEGMENT_OFF); 626 break; 627 628 case 1: 629 digitalWrite(segA, SEGMENT_OFF); 630 digitalWrite(segB, SEGMENT_ON); 631 digitalWrite(segC, SEGMENT_ON); 632 digitalWrite(segD, SEGMENT_OFF); 633 digitalWrite(segE, SEGMENT_OFF); 634 digitalWrite(segF, SEGMENT_OFF); 635 digitalWrite(segG, SEGMENT_OFF); 636 break; 637 638 case 2: 639 digitalWrite(segA, SEGMENT_ON); 640 digitalWrite(segB, SEGMENT_ON); 641 digitalWrite(segC, SEGMENT_OFF); 642 digitalWrite(segD, SEGMENT_ON); 643 digitalWrite(segE, SEGMENT_ON); 644 digitalWrite(segF, SEGMENT_OFF); 645 digitalWrite(segG, SEGMENT_ON); 646 break; 647 648 case 3: 649 digitalWrite(segA, SEGMENT_ON); 650 digitalWrite(segB, SEGMENT_ON); 651 digitalWrite(segC, SEGMENT_ON); 652 digitalWrite(segD, SEGMENT_ON); 653 digitalWrite(segE, SEGMENT_OFF); 654 digitalWrite(segF, SEGMENT_OFF); 655 digitalWrite(segG, SEGMENT_ON); 656 break; 657 658 case 4: 659 digitalWrite(segA, SEGMENT_OFF); 660 digitalWrite(segB, SEGMENT_ON); 661 digitalWrite(segC, SEGMENT_ON); 662 digitalWrite(segD, SEGMENT_OFF); 663 digitalWrite(segE, SEGMENT_OFF); 664 digitalWrite(segF, SEGMENT_ON); 665 digitalWrite(segG, SEGMENT_ON); 666 break; 667 668 case 5: 669 digitalWrite(segA, SEGMENT_ON); 670 digitalWrite(segB, SEGMENT_OFF); 671 digitalWrite(segC, SEGMENT_ON); 672 digitalWrite(segD, SEGMENT_ON); 673 digitalWrite(segE, SEGMENT_OFF); 674 digitalWrite(segF, SEGMENT_ON); 675 digitalWrite(segG, SEGMENT_ON); 676 break; 677 678 case 6: 679 digitalWrite(segA, SEGMENT_ON); 680 digitalWrite(segB, SEGMENT_OFF); 681 digitalWrite(segC, SEGMENT_ON); 682 digitalWrite(segD, SEGMENT_ON); 683 digitalWrite(segE, SEGMENT_ON); 684 digitalWrite(segF, SEGMENT_ON); 685 digitalWrite(segG, SEGMENT_ON); 686 break; 687 688 case 7: 689 digitalWrite(segA, SEGMENT_ON); 690 digitalWrite(segB, SEGMENT_ON); 691 digitalWrite(segC, SEGMENT_ON); 692 digitalWrite(segD, SEGMENT_OFF); 693 digitalWrite(segE, SEGMENT_OFF); 694 digitalWrite(segF, SEGMENT_OFF); 695 digitalWrite(segG, SEGMENT_OFF); 696 break; 697 698 case 8: 699 digitalWrite(segA, SEGMENT_ON); 700 digitalWrite(segB, SEGMENT_ON); 701 digitalWrite(segC, SEGMENT_ON); 702 digitalWrite(segD, SEGMENT_ON); 703 digitalWrite(segE, SEGMENT_ON); 704 digitalWrite(segF, SEGMENT_ON); 705 digitalWrite(segG, SEGMENT_ON); 706 break; 707 708 case 9: 709 digitalWrite(segA, SEGMENT_ON); 710 digitalWrite(segB, SEGMENT_ON); 711 digitalWrite(segC, SEGMENT_ON); 712 digitalWrite(segD, SEGMENT_ON); 713 digitalWrite(segE, SEGMENT_OFF); 714 digitalWrite(segF, SEGMENT_ON); 715 digitalWrite(segG, SEGMENT_ON); 716 break; 717 718 // all segment are ON 719 case 10: 720 digitalWrite(segA, SEGMENT_OFF); 721 digitalWrite(segB, SEGMENT_OFF); 722 digitalWrite(segC, SEGMENT_OFF); 723 digitalWrite(segD, SEGMENT_OFF); 724 digitalWrite(segE, SEGMENT_OFF); 725 digitalWrite(segF, SEGMENT_OFF); 726 digitalWrite(segG, SEGMENT_OFF); 727 break; 728 729 } 730 731} 732
Downloadable files
Circuit
Circuit diagram of the project
Circuit

Circuit
Circuit diagram of the project
Circuit

Comments
Only logged in users can leave comments