What am I missing????


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default still no good

    thanks for your suggestion sayzer, I see where I made a mistake in that code but there is still a problem which creates the same result. or am I missing something else.
    Code:
    UP var PORTA.0	' Press to Decrement Button
    	Enter var PORTA.1	' Press to Set/memorise Button
    	Down var PORTA.2	' Press to Increment Button
    	CounterC var Byte
    
    
    
    	LCDOut $FE,1		' Clear LCD
    
    	
    
    	CounterC=0		' Set to Start of Setup (seven steps from 0 to 6)
    
    SetupLoop:
    	LCDOut $FE,1,"Set "
    	pause 1000
    		'
    	If CounterC=0 then
    		LCDOut "Real Time"
    		endif
    	If CounterC=1 then 
    		LCDOut "On Time"
    		endif
    	If CounterC=2 then
    		LCDOut "Off Time"
    		endif
    	If CounterC=3 then 
    		LCDOut "Date"
    		endif
    	If CounterC=4 then
    		LCDOut "Day Temp"
    		endif
    	If CounterC=5 then
    		LCDOut "Night Temp"
    		endif
    	If CounterC=6 then
    		LCDOut "MODE"
    		endif
    
    		'
    
    		'	--------------------
    SetupDisplayLoop:
    		
    	If Enter = 1 then
            if CounterC=0 then Set_time
           
            If counterC=1 Then Set_ontime 
            
            if counterC=2 Then Set_offtime
          
           	if counterC=3 Then Set_Date
        
            if counterC=4 Then Set_dtemp
       
            if counterC=5 Then Set_ntemp
    
            if counterC=6 Then Set_Btemp
      
    	endif
    	
    IF UP = 1 THEN 
     WHILE UP = 1 : WEND
     IF CounterC < 6 THEN CounterC = CounterC + 1
    ENDIF
    
    
    IF DOWN = 1 THEN
     WHILE DOWN = 1 : WEND
     IF CounterC > 0 THEN CounterC = CounterC - 1
    ENDIF
    
    goto setupLoop
    
    Set_time:
    Set_ontime:
    Set_offtime:
    Set_Date:
    Set_dtemp:
    Set_ntemp:
    Set_Btemp:
    End

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    What happens when the program jumps to "Set_time" subroutine?

    There is no GOTO there. None of them has.

    Thus, your program stops.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Apr 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default

    I'm really just wanting to make a kind of graphic interface so I can navigate. eg I want to be able to press up and down to show real time, on time, off time etc then click enter to goto the labels

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sayzer
    What happens when the program jumps to "Set_time" subroutine?

    There is no GOTO there. None of them has.

    Thus, your program stops.
    As sayzer has posted, you need to have a goto setuploop just before your end statement. That's what you're missing

  5. #5
    Join Date
    Apr 2008
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Sorted

    thanks for you suggestions but i don't think I was explaining myself properly, Anyway I nutted it out and got it working. cheers
    Code:
    SetupLoop:
    	LCDOut 254,1,"Set "
    	
    SetupDisplayLoop:
    	If CounterC=0 then
    		LCDOut 254,132,"Real Time "
    		endif
    	If CounterC=1 then 
    		LCDOut 254,132,"On Time   "
    		endif
    	If CounterC=2 then
    		LCDOut 254,132,"Off Time  "
    		endif
    	If CounterC=3 then 
    		LCDOut 254,132,"Date      "
    		endif
    	If CounterC=4 then
    		LCDOut 254,132,"Day Temp  "
    		endif
    	If CounterC=5 then
    		LCDOut 254,132,"Night Temp"
    		endif
    	If CounterC=6 then
    		LCDOut 254,132,"MODE      "
    		endif
    		
    	If Enter = 1 then
            if CounterC=0 then Set_time
           
            If counterC=1 Then Set_ontime 
            
            if counterC=2 Then Set_offtime
          
           	if counterC=3 Then Set_Date
        
            if counterC=4 Then Set_dtemp
       
            if counterC=5 Then Set_ntemp
    
            if counterC=6 Then Set_Btemp
      
    	endif
    	
    IF UP = 1 THEN 
     pause 100
     IF CounterC < 6 THEN CounterC = CounterC + 1
    ENDIF
    
    
    IF DOWN = 1 THEN
     pause 100
     IF CounterC > 0 THEN CounterC = CounterC - 1
    ENDIF
    
    goto setupdisplayLoop
    
    Set_time:
    Set_ontime:
    Set_offtime:
    Set_Date:
    Set_dtemp:
    Set_ntemp:
    Set_Btemp:
    End

Similar Threads

  1. Missing a bit
    By l_gaminde in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st August 2009, 18:54
  2. I am missing something, what is wrong with this code?
    By manta_z in forum mel PIC BASIC
    Replies: 3
    Last Post: - 26th April 2009, 23:15
  3. PIC18F4550 Error[128] Missing Arguments
    By damalu in forum mel PIC BASIC
    Replies: 9
    Last Post: - 17th November 2008, 21:47
  4. MCP23016 missing D7 on I2CRead
    By TWSK in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th June 2007, 18:37
  5. What am I missing
    By PaulB in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th November 2004, 16:15

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