element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs 15-second binary countdown timer
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 6 Jan 2016 11:04 PM Date Created
  • Views 334 views
  • Likes 2 likes
  • Comments 2 comments
  • binary
  • timer
  • countdown
  • arduino
Related
Recommended

15-second binary countdown timer

Former Member
Former Member
6 Jan 2016

Thanks to John, Shabaz and Dragan for helping me.  

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image
jw0752 shabaz tomaja

 

/*
  binary countdowntime
  Kenneth Thomas January 5, 2016
  Open source..
*/
int greenLED = 13;
int redLED = 12;
int blueLED = 11;
int whiteLED = 10;
int flash = 1000;


void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT); //green
  pinMode(12, OUTPUT); //red
  pinMode(11, OUTPUT); //blue
  pinMode(10, OUTPUT); //white
}


void loop() {
  for(int x = 0; x < 8; x++){
    if(x==0){
      digitalWrite(10, HIGH);
      digitalWrite(13,HIGH);
      digitalWrite(12,HIGH);
      digitalWrite(11,HIGH);
      delay(flash);
      digitalWrite(11,LOW);
      delay(flash);         
    } else if(x==1){
      digitalWrite(12,LOW);
      digitalWrite(11,HIGH);
      delay(flash);
      digitalWrite(11,LOW);
      delay(flash);
    } else if(x==2){
      digitalWrite(13, LOW);
      digitalWrite(12, HIGH);
      digitalWrite(11, HIGH);
      delay(flash);
      digitalWrite(11, LOW);
      delay(flash);
    } else if(x==3){
      digitalWrite(12, LOW);
      digitalWrite(11, HIGH);
      delay(flash);
      digitalWrite(11, LOW);
      delay(flash);
    } else if(x==4){
      digitalWrite(10, LOW);
      digitalWrite(13,HIGH);
      digitalWrite(12,HIGH);
      digitalWrite(11,HIGH);
      delay(flash);
      digitalWrite(11,LOW);
      delay(flash);         
    } else if(x==5){
      digitalWrite(12,LOW);
      digitalWrite(11,HIGH);
      delay(flash);
      digitalWrite(11,LOW);
      delay(flash);
    } else if(x==6){
      digitalWrite(13, LOW);
      digitalWrite(12, HIGH);
      digitalWrite(11, HIGH);
      delay(flash);
      digitalWrite(11, LOW);
      delay(flash);
    } else if(x==7){
      digitalWrite(12, LOW);
      digitalWrite(11, HIGH);
      delay(flash);
      digitalWrite(11, LOW);
      delay(flash);
    }
}
}

  • Sign in to reply
  • Former Member
    Former Member over 7 years ago in reply to DAB

    Thank you, DAB. 

     

    I appreciate it.

     

    Cheers, Ken

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 7 years ago

    Very nice post.

     

    I have to admit, it has been a while since I worked in binary, but it came back very quickly once I realized it was counting down.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube