Thread: Help with Coding a PIC for automated watering system

  1. #1
    Registered User
    Join Date
    Dec 2018
    Posts
    1

    Help with Coding a PIC for automated watering system

    Hi guys,

    I'm new to programming and for my final year project at university I am having to program a PIC 18F2420 using C to water plants when a soil moisture sensor has an digital output of 0. I would like it to only measure every 10 minutes and sleep the rest of the time to conserve energy. I have literally no idea how to do this any help you could give me would be greatly appreciated. I have many books but I still don't seem to understand it.

    Thanks

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    658
    Quote Originally Posted by georginamc View Post
    Hi guys,

    I'm new to programming and for my final year project at university I am having to program a PIC 18F2420 using C to water plants when a soil moisture sensor has an digital output of 0. I would like it to only measure every 10 minutes and sleep the rest of the time to conserve energy. I have literally no idea how to do this any help you could give me would be greatly appreciated. I have many books but I still don't seem to understand it.

    Thanks
    "I'm new to programming..."

    Have you at least taken a intro course in C? If not, you would need to at least work through a good book on C first, programming all the exercises first, before attacking this application, plus studying the documentation for the microprocessor.

    Sorry, but I think you are not ready.

    Two good books I recommend:

    C Programming, A Modern Approach
    Author: K. N. King

    or

    C Primer Plus, 6th Edition
    Stephen Prata

    Choose one only.

  3. #3
    Registered User Kernelpanic's Avatar
    Join Date
    Sep 2018
    Location
    Berlin
    Posts
    103
    I don't think so that you can programming a Microcontroller with normal C. Here is an online tutorial for programming the PIC Mics:

    https://de.scribd.com/doc/886920/PICmicro-MCU-C-An-Introduction-to-Programming-the-Microchip-PIC-in-CCS-C#fullscreen

    For download:
    https://de.scribd.com/doc/886920/PICmicro-MCU-C-An-Introduction-to-Programming-the-Microchip-PIC-in-CCS-C

    Here is a tutorial too, in German, but there are certainly enough in English.
    pic: C für PICs


    And this is an IDE for programming PICs:
    Download and Install MPLAB X IDE - Developer Help

  4. #4
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    658
    My point was that I don't think @georginamc is ready to program any "final year project" C program on a Linux or other hosted system, let alone, a microcontroller.

  5. #5
    Registered User Kernelpanic's Avatar
    Join Date
    Sep 2018
    Location
    Berlin
    Posts
    103
    Quote Originally Posted by rstanley View Post
    My point was that I don't think @georginamc is ready to program any "final year project" C program on a Linux or other hosted system, let alone, a microcontroller.
    Yeah, it's not rare: A-last-minute-panic-call for an University Year Project.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with a automated cash program! PLEASE!
    By alias in forum C Programming
    Replies: 12
    Last Post: 09-20-2011, 12:36 PM
  2. Automated CVS-VC6 building
    By andwan0 in forum C++ Programming
    Replies: 2
    Last Post: 03-19-2009, 12:11 PM
  3. Security on automated home
    By stimpyzu in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-11-2004, 01:14 AM
  4. coding a new operating system like linux
    By codefx in forum Tech Board
    Replies: 3
    Last Post: 12-06-2002, 11:23 PM

Tags for this Thread