loading
 
Anonymous 17 year
So I have been slowly working through the propeller labs.  Taking a small baby step, I am trying to get roborealm to recognize a button being pushed.  Using the following spin code I can watch the button being pushed in the terminal emulator it correctly produces a carriage return, a 0, or a 1, and a tab:
{{
DisplayPushbuttons2.spin
Display pushbutton states with roborealm}}

CON
  
  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

OBJ
  
  Debug: "FullDuplexSerialPlus"  
  
PUB TerminalPushbuttonDisplay

  Debug.start(31, 30, 0, 57600) ' initiates serial connection
  waitcnt(clkfreq*7 + cnt)            ' waits 7 seconds                                        
  repeat
     If ina[10] == 1   ' if the button on pin 10 is pushed
       Debug.str(String(13,"1",9)) 'output <cr>1<tab>
     else
       Debug.str(String(13,"0",9)) 'output <cr>0<tab>
     waitcnt(clkfreq/100 + cnt)  'wait 1/100 second before repeat


on the roborealm side, I have loaded serial control and Watch_Variables. I can connect to the com port at 57600 and the only thing I have is

<cr>[Button]<tab>

under receive sequence.

I open Watch_Variables and it sticks at "0" no matter the state of the button.

Do I need an initialization sequence?  If I do, it is unclear to me if I need an initialization sequence at every connect to update the state of [Button] or just once at the beginning.  

This is my initial attempt at a "HELLO WORLD" type of program to get information from the propeller to Roborealm.  I feel I am missing something obvious.

thanks,
grindel


Anonymous 17 year
Sorry about being retarded about the title again, I accidently hit new instead of reply.  "Name" doesn't work consistently for me, so there is that too.

Thanks everybody for their understanding,
grindel

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index