Programming/Nesting Order ???


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gtvmarty View Post
    My main question: Is there a 'preferred order' to layout programming code/loops/nesting within nests etc.
    Yep...Your Order. You're the programmer. The order is up to you.

    For example, i might have a 16x2 LCD, a few buttons (or keypad), a few leds, switches or rotary encoder and/or a few external lines to the outside world.
    In my mind, the user comes first, everything else is secondary. You get stuck in a loop checking buttons and the LCD won't update and the user probably doesn't get any feedback that your button press has been recognized. Find something to make some feedback, blink the backlight on the LCD, blink an LED, add a small speaker and make it beep.

    I know someone will say "use an interupt" but i haven't got that deep into using interupts yet...
    It's the only way to go... Play with them. They're easier than you think...

  2. #2
    Join Date
    Jul 2008
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Thanx for the info so far guys....

    I've since found (well hidden) in the back of the PB manual that i should be using for..next loops for delays instead of "pause 1000", otherwise i need to wait for the 1sec to elapse before my key's are read in etc (obviously missing keystrokes during that 1 second).
    That's a MAJOR part of my problem solved.

    Yep, i had been thru all the "flashing-LCD-by-writing-too-often-in-a-loop" problems ;-)


    I'm still not keen on interupts ;-) but am finding (with lotsa fiddling) that i can nest loops within loops nicely now, and i do have priorities to loop more often for keys than LCD writes etc.

    Thanx again,
    Marty.

Similar Threads

  1. Reverse Bit Order?
    By Art in forum General
    Replies: 3
    Last Post: - 23rd January 2010, 22:52
  2. In what order do we construct a PBP program?
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th October 2008, 08:18
  3. Large-ish PCB order...others wanted...
    By skimask in forum Off Topic
    Replies: 0
    Last Post: - 16th June 2006, 02:43
  4. How can i control pic input pins order?
    By tanero in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th August 2005, 12:46
  5. bit order inverting
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th July 2005, 03:37

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts