quick question


Closed Thread
Results 1 to 5 of 5

Thread: quick question

Hybrid View

  1. #1
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: quick question

    One way to get a “sort of random number” is to start a timer, and then let the watchdog timer do a reset which will not ruin the timer values.
    Then you can read them and you get different values each time in some limited range that you could multiply or divide.
    The next time the program starts after the reset, the timer values will be non zero before you started the timer. Then service the watchdog timer from then on.

    I left an example here at some stage that allowed a pic to determine from a list of specific values, what speed crystal is running the pic.

    Another way might be to let the POT command do what it does, and time the discharge of a capacitor through a resistor.
    You should be able to fiddle with resistor and capacitor values to make the POT command return inconsistent readings.

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: quick question

    Can you add a pot?

    I'd connect it to an analog input, read the value, establish a pause or loop on that value then start main loop.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. A quick question.....
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2010, 14:25
  2. Quick DS18B20 question
    By gti_uk in forum General
    Replies: 4
    Last Post: - 21st June 2009, 17:24
  3. Interrupt Quick Question
    By shawn in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2005, 05:51
  4. quick question
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd December 2004, 01:45

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