Does variable value change being transferred to code running in interrupt loop?


Results 1 to 28 of 28

Threaded View

  1. #24
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Does variable value change being transferred to code running in interrupt loop?

    CuriousOne, The Parallax Propeller is truly a multicore processor. You would need multiple Pic's to do the same.
    I don't see the difference in your code next to what I am suggesting? The way your's is written it will not produce the output you require.And what do you mean terminated? How about this for an interrupt example:
    a = 1
    MAIN:
    if Interrupt = 1 then
    Interrupt = 0
    if PROG = 0 then
    gosub program 1
    else
    gosub program 2
    endif
    endif
    a = a + 1
    if a > 10 then a = 0
    goto main

    Program1:
    PRINT "A=";A
    return

    Program2:
    PRINT "B=";B
    return

    This will produce the output you require.

    Or without interrupts, Your way..
    A=1
    B=1
    DO:
    PRINT "A=";A
    PRINT "B=";B
    A=A+1
    B=B+1
    IF A > 10 THEN A = 1
    IF B > 10 THEN B = 1
    LOOP

    This will produce the same output you require.
    Last edited by Dave; - 7th April 2015 at 22:23.
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. Can not change variable while using DT_INT?
    By hvguy0 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 29th March 2013, 23:05
  2. Altering a variable in a loop.
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 18th September 2012, 06:24
  3. Change a variable to the opposite?
    By Hylan in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 21st June 2012, 07:00
  4. Change variable allocation to save code space
    By aberco in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 5th September 2011, 01:28
  5. 16f84a running interrupt PICBASIC code
    By divaker in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 31st July 2008, 15:49

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