element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • 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 Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
  • Settings
Merry Boxes & LEDs
  • Challenges & Projects
  • Project14
  • Merry Boxes & LEDs
  • More
  • Cancel
Merry Boxes & LEDs
Blog JackBox #6 : The Completed Article
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Merry Boxes & LEDs to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dubbie
  • Date Created: 9 Jan 2019 5:27 PM Date Created
  • Views 4008 views
  • Likes 16 likes
  • Comments 17 comments
  • merryboxesledsch
  • holidayspecial19ch
  • leds.
  • buildapresentch
Related
Recommended

JackBox #6 : The Completed Article

dubbie
dubbie
9 Jan 2019

Having completed adding the sound in my last Blog I decided to improve the LED part a little bit. I took three of the LEDs white wooden snowflakes shapes and fixed them to the front and sides of the box. Rather than just these three LEDS on and off I decided to fade them on and off. To do this I just connected the three LEDs in parallel and then the positive (the anode) to the +5V from the Nano and the negative (the cathode) to the D5 output of the Nano. The LEDs will all come on when D5 is driven low. To create the fade on and off effect I used pulse width modulation implemented as next for loops, as illustrated in the code fragment below. I used a function just to make it tidier. The value input into the function controls the maximum brightness achieved by the LED, which also controls the frequency of the LED slowly pulsing.

 


void pulse_WHITE(int brightness)

{

int move_index, LED_index;

   for (move_index = 1; move_index < brightness; move_index++)
      {
        for (LED_index = 0; LED_index < LED_speed; LED_index++)
          {
           digitalWrite(LED1, LOW);
           delayMicroseconds(move_index);
           digitalWrite(LED1, HIGH);
           delayMicroseconds(252- move_index);
          } /* for */
      } /* for */
    for (move_index = brightness  ; move_index > 0; move_index--)
      {
        for (LED_index = 0; LED_index < LED_speed; LED_index++)
          {
           digitalWrite(LED1, LOW);
           delayMicroseconds(move_index);
           digitalWrite(LED1, HIGH);
           delayMicroseconds(252- move_index);
          } /* for */
      } /* for */
} /* pulse_WHITE

 

I added this to the Nano programme, adjusted when the sound should start playing back the recorded audio and tidied it up as best as I could. Below is the final video of the whole thing. I decided to add some clockwork Father Christmasses and Reindeers to provide that little bit extra enhancement and merriment(!).

 

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

 

It's been fun but I'm glad it's over now as the constant tuneless recorded singing was beginning to drive me mad!

 

Dubbie

  • Sign in to reply

Top Comments

  • DAB
    DAB over 6 years ago +6
    Fun project for the holidays. Easily replicated for any specific holiday or event you want. DAB
  • ntewinkel
    ntewinkel over 6 years ago +5
    So cool! I like that you hit all the targets: it's merry, it's a box, it has LEDs. The Santas and reindeer added a total bonus to complete the effect -Nico
  • three-phase
    three-phase over 6 years ago +4
    Good to see the project finished Kind regards
Parents
  • three-phase
    three-phase over 6 years ago

    Good to see the project finished

     

    Kind regards

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • three-phase
    three-phase over 6 years ago

    Good to see the project finished

     

    Kind regards

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • dubbie
    dubbie over 6 years ago in reply to three-phase

    Donald,

     

    I wasn't sure it was going to get finished at times, especially when trying to get the wooden star to hang properly inside the box. I just couldn't see what was going on as the box was closed.

     

    Dubbie

    • Cancel
    • Vote Up +4 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 © 2025 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

  • X
  • Facebook
  • linkedin
  • YouTube