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
CodeBug
  • Learn
  • Learning Center
  • STEM Academy
  • CodeBug
  • More
  • Cancel
CodeBug
Blog 10 CodeBug Projects in 10 Days: A Card For All Occasions
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
CodeBug requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: element14Dave
  • Date Created: 23 Sep 2015 8:27 PM Date Created
  • Views 922 views
  • Likes 20 likes
  • Comments 6 comments
  • codebug_intermediate
Related
Recommended

10 CodeBug Projects in 10 Days: A Card For All Occasions

element14Dave
element14Dave
23 Sep 2015
imageIntroducing CodeBug!

image  What is CodeBug

image  10 CodeBug Projects in 10 Days

image  Are You a STEM Educator?

 



We start the project by visiting the CodeBug website http://www.codebug.co.uk and creating an image

account. It only takes a few minutes. While logged in, clock on Create to start a new project. Don't forget to save your work!

 

The interface for CodeBug contains an area to the right of the screen with is the primary programming interface. There are a series of menus that are used to store the blocks with can be dragged from the menus into the coding area. Good blocks are made to connect together, and that is what we intend to do!


Now that you have familiarized yourself with the interface, let's get started on an intermediate project Thomas Macpherson-Pope pulled together from CodeBug.org.uk

 


What you need:

CodeBug

Micro USB Cable

CR2032 Battery

Computer

Card


The Project


CodeBug can scroll messages so you can create a fun personalized card, that can be adapted for different occasions.To tell CodeBug what to do, you need to give it a list of simple instructions. This list of instructions is known as a program. You can use this website to create programs and you will be able to see them in action before downloading them and programming CodeBug. CodeBug’s LED grid can display letters. If we move these letters from one side of the grid to the other, we can have another letter moving in after it.

Let's start coding the Display and we begin at...well the start which is a pre-existing block in which the coding is  ready to be built on! The Start block can be used to configure CodeBug when we run the emulation on the interface, for this project we will keep it as is.

 

For this block of code we are going to select the Scroll Sprite block from the Sprite Menu and connect it to the Start Block. This block will scroll the content to the left of the LED matrix. Since we will need something to scroll, let's also go ahead and use the Get String Sprite, also found on the Sprite Menu, and connect it to the Scroll Sprite block. The default text for the Scroll Sprite block is "Hello World", which we have replaced with "Have a Great Day!". Within the Scroll Sprite block you can change the rate of which the letter will scroll (we have is set at the default 100ms) or the direction of the scroll ( left,right,up, down).

 

At this point the program will scroll the "Happy Birthday!" message, but only once. For the purposes of this project we will need it to scroll repeatedly. Let's add a Repeat While True block to repeat (loop) the blocks inside it. From the Loops menu drag in the Repeat While True block into an empty area on the Workplace. Next we will drag the Scroll Sprite block into the body of the Repeat While True block so your code will repeat continuously. We'll drag that While Loop and its block onto the Start block.We don't want the CodeBug to start until a button is pressed so from the Basics menu, we'll select Sleep Until Button Changes above the Repeat While True block. 

 

image

 

From there you can run an emulator to see how the program would look on the CodeBug...

 

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

 



With the code working, click on Download, it's just under the simulator controls. When the code downloads, plug in a USB to micro USB into your computer. While holding Button A of your CodeBug also insert the micro USB to the CodeBug. The top left LED in the matrix on the CodeBug will flash. Your computer should also recognize the CodeBug as a USB drive on your computer. Copy the code downloaded from the CodeBug website to the USB drive and run the program by pressing Button B.

image


CodeBug can be powered by battery so you can take it wherever you want! To power CodeBug by battery, first unplug the Micro-USB cable, do not worry as CodeBug will remember your program without being plugged in. Now slide in a coin battery (CR2032) with the positive (plus symbol) side up. Your program will begin running again!

 

To make your card, download the attached template.and print it out. Lightly tack the template to some coloured card with some sellotape and draw along the lines of the template, to indent the shapes into the card below. Remove the template and cut out the shapes on the card.

Now insert CodeBug’s buttons into the two little squares in the card, from the inside of the card. Put some sellotape on the back of CodeBug to fix it to the card.

image

Your card is finished! Grab some pens and decorate your new interactive card. You could even try cutting out the Great Day message and stick different colored card behind each letter.

image

REMIX THIS PROJECT


See more CodeBug projects and learn how you can get one of your own by visiting: 10 CodeBug Projects in 10 Days

Attachments:
imagecard-template.pdf
  • Sign in to reply

Top Comments

  • gadget.iom
    gadget.iom over 7 years ago +2
    Thats a great concept for gifting a CodeBug!
  • gadget.iom
    gadget.iom over 7 years ago in reply to gadget.iom +2
    Something like this:
  • Former Member
    Former Member over 7 years ago in reply to gadget.iom +1
    Not to worry, the codebug goes back to sleep after 3 minutes anyway (default, can be modified in the start button options).
  • mcb1
    mcb1 over 7 years ago in reply to dwinhold

    I think this will be my Christmas cards this year.

    Good idea ...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dwinhold
    dwinhold over 7 years ago

    This is a great idea, to give an interactive card with the ability to introduce anyone to programming. I think this will be my Christmas cards this year.

     

    Dale

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 7 years ago in reply to gadget.iom

    Not to worry, the codebug goes back to sleep after 3 minutes anyway (default, can be modified in the start button options).

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • gadget.iom
    gadget.iom over 7 years ago in reply to gadget.iom

    Something like this:

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • gadget.iom
    gadget.iom over 7 years ago

    It might be worth modifying the code so that it will only repeat X number of times (the number can be substantial). It just means that an accidental press of a button during delivery wouldn't flatten the battery before the recipient gets it. image

    • 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