Does my code need tidying up?


Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Dec 2007
    Posts
    60

    Default Does my code need tidying up?

    Hi all,

    I'm very new to Pic's, but I have a PHP & MYSQL coding background, and a fair bit of basic coding quite a long time ago. Also I'm a plasma and LCD TV tech, so the electronics side of things isn't too much of a struggle yet.

    My project below is going to control air-conditioning in my car, and also show some stats like batt voltage etc but is far from finished. So far I have the voltage measurement working right (and adjustable for different voltage divider networks via the 4 buttons and LCD)

    Also the TPS (throttle position sensor) is adjustable for different cars (throttle low - press butdn, throttle high - press butup - it then scales to 0 - 100%)

    working on air temperature, but only have a very non-linear sensor currently, and will get something nicer like the BS1820 (i think?) before I convert it to degrees. (butdn records the current voltage and sets it as minimum.)

    This is really my first effort at pic programming and I am completely self-taught... Just wanted to get some opinions on if there is better ways of doing things... So far my code works fine but I feel it's quite 'messy'.

    Ignore any PWM stuff for now I was just testing it on a small motor... I will get round to speed regulating the thermofan based on speed/temperature/etc later.



    Also I should add I have a 2-line LCD in 4 bit mode hanging off a 16F877A

    Thanks in advance.
    Attached Files Attached Files
    Last edited by davewanna; - 10th December 2007 at 03:35.

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

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