Thread: Serial controller algorithm

  1. #16
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Make a list of 5 things you need to do.
    For each thing, look at how simple it is and how you might write the code for it. If it's complicated, break it down into at most 5 more steps. Keep going until everything looks simple.

    Eg, making tea.
    1. Boil water
    2. Add tea bag
    3. Pour water
    4. Add milk and sugar
    5. Drink

    So
    1. Boil water
    might be
    1.1 Open kettle
    1.2 Open tap
    1.3 Add water
    1.4 Close tap and kettle
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  2. #17
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    Quote Originally Posted by Salem View Post
    1. Boil water
    2. Add tea bag
    3. Pour water
    #ifdef IS_ENGLISH
    4. Add milk and sugar
    4.1 Remove teabag
    #else
    4. Remove teabag
    4.1 Add milk and sugar
    #end
    5. Drink
    QuantumPete
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  3. #18
    Registered User
    Join Date
    Aug 2007
    Posts
    85
    that depends on the controller's interface. what data do you have to send to him?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 03:27 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 04:59 PM