View unanswered posts | View active topics It is currently Sat Oct 25, 2014 5:13 pm






Reply to topic  [ 5 posts ] 
NXT Alarm Clock Challenge, or the... 
Author Message
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 596
Post NXT Alarm Clock Challenge, or the...
"I still couldn't think of a more original name for this!" Challenge.

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 :twisted: )

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.

Good luck, and happy coding!

Attachment:
File comment: The long, uncut version of the Alarm Clock program (NXT).
Alarm_Clock_One_Task_NXT.c [8.82 KiB]
Downloaded 369 times


*This is a sister challenge to the VEX Alarm Clock Challenge.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Last edited by JohnWatson on Mon Apr 15, 2013 9:09 am, edited 1 time in total.



Fri Jul 20, 2012 3:39 pm
Profile
Rookie

Joined: Thu Sep 13, 2012 9:43 am
Posts: 47
Post Re: NXT Alarm Clock Challenge, or the...
There goes my weekend then:-)

I saw this sleep manager Android app on Lifehacker http://lifehacker.com/5942519/sleep-time-alarm-clock-for-android-watches-your-sleep-cycles-wakes-you-gently the other day. The linked article is a little short on content, but it raises some interesting concepts that the alarm/sleep app covers.


Sat Sep 15, 2012 5:28 am
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: NXT Alarm Clock Challenge, or the...
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-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Sat Sep 15, 2012 10:35 am
Profile WWW
Rookie

Joined: Wed Nov 14, 2012 1:14 am
Posts: 1
Post 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

_________________
http://www.boku.ac.at/
http://www.pmi.org/
www.braindumps.com
https://www.ethz.ch/en.html


Wed Nov 14, 2012 1:20 am
Profile
Rookie

Joined: Thu Sep 13, 2012 9:43 am
Posts: 47
Post Re: NXT Alarm Clock Challenge, or the...
JohnWatson wrote:
"I still couldn't think of a more original name for this!" Challenge.

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 :twisted: )

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.

Good luck, and happy coding!

Attachment:
Alarm_Clock_One_Task_NXT.c


*This is a sister challenge to the VEX Alarm Clock Challenge.


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.


Thu Nov 15, 2012 4:48 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: Ben and 2 guests


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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.