Alarm clocks. We have them, we use them, and we eventually grow to hate them. Those annoying little monstrosities are the source of our continued employment and the slayer of our peaceful rest. To help ease the pain of having your serene slumber shattered by a blaring siren, we’ve created a program that will turn a NXT brick into a basic alarm clock (code attached).

Here’s the catch; although the code is correct and will work, it is very poorly written. It’s all in task main running straight through with little room for flexibility; there are no functions or multitasking involved. Clearly, this is sub-optimal code.

This is where you come in. We would like you, the ROBOTC community, to showcase how you would rewrite the code to make it better. Where can it be improved? What can be cut out? Where can it be more flexible? The fun doesn’t stop there, though (we can’t make this easy now, can we?): the challenge is to showcase the different styles and approaches to coding, so we’d like to see what you can come up with.

Specifically-How to make the most streamlined code (fewest lines, for instance)-How to make the most flexible code (switching out 12 hour to 24 time format, etc)-Who can make the most ‘inventive’ code (one idea was to make the robot ‘run away’ from the groggy user trying to shut the alarm off )

We want to see what the community can come up with, the processes involved, the pros and cons of various coding styles, etc. More importantly, we want this to be a fun learning experience for all involved, and to that end we encourage this to be an open brainstorming session.

Seems I somehow missed this until now. I will definitely enter, eventually. Probably sometime at the end-ish of October. My robot club is have their bi-annual competition October 14th, so I needz 2 buildz moar robotz.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Sat Sep 15, 2012 10:35 am

coool

Rookie

Joined: Wed Nov 14, 2012 1:14 amPosts: 1

Re: NXT Alarm Clock Challenge, or the...

When should one use multitasking then? Imagine a program that drives a robot around a room vacuuming up objects while avoiding people. The robot comes with an emergency stop button just incase the systems for avoiding people fail or the robot uprising begins and we need to deactivate our robot quickly (in the real world, kill switches are important for human safety). How would a flowchart for this program look like? It is difficult to make a linear step-by-step chart for this program because it is doing multiple things at the same time. Also, the emergency stop button needs constantly be checking while other behaviors are running because the robot must stop immediately when the button is pressed, no matter what else it may be doing at the time. We need multiple flow charts side-by-side

Alarm clocks. We have them, we use them, and we eventually grow to hate them. Those annoying little monstrosities are the source of our continued employment and the slayer of our peaceful rest. To help ease the pain of having your serene slumber shattered by a blaring siren, we’ve created a program that will turn a NXT brick into a basic alarm clock (code attached).

Here’s the catch; although the code is correct and will work, it is very poorly written. It’s all in task main running straight through with little room for flexibility; there are no functions or multitasking involved. Clearly, this is sub-optimal code.

This is where you come in. We would like you, the ROBOTC community, to showcase how you would rewrite the code to make it better. Where can it be improved? What can be cut out? Where can it be more flexible? The fun doesn’t stop there, though (we can’t make this easy now, can we?): the challenge is to showcase the different styles and approaches to coding, so we’d like to see what you can come up with.

Specifically-How to make the most streamlined code (fewest lines, for instance)-How to make the most flexible code (switching out 12 hour to 24 time format, etc)-Who can make the most ‘inventive’ code (one idea was to make the robot ‘run away’ from the groggy user trying to shut the alarm off )

We want to see what the community can come up with, the processes involved, the pros and cons of various coding styles, etc. More importantly, we want this to be a fun learning experience for all involved, and to that end we encourage this to be an open brainstorming session.

Still not had time to sit and have a go at this, but I saw Clocky http://www.nandahome.com/ an angel tech 'robot' clock that 'runs away from your bed after you have hit snooze and thought it might be another interesting angle.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum