Shop OBEX P1 Docs P2 Docs Learn Events
Help with compiler error. — Parallax Forums

Help with compiler error.

mynet43mynet43 Posts: 644
edited 2012-05-26 09:42 in Propeller 1
I'm trying to write a while loop to wait for a pin to change state. I need to do it without using waitpeq or waitpne.

When I compile the following code, I get a syntax error after the ina.

Please let me know how to write this line correctly.

Thank you for your help.

Jim

This is a snippet of the code...
CON
  _CLKMODE      = XTAL1 + PLL16X                        
  _XINFREQ      = 5_000_000

  RESET         = 23            ' define RESET pin
  LED_PIN       = 24            ' Flash LED from this Pn number.
  P25           = 25            ' set P25 variable to P25 pin
  CLK_PIN       = 26            ' 5 MHz output pin number
  LCD_PIN       = 27            ' LCD Tx Serial Output Pin

  S1_PIN        = 1             ' Sensor S1 on P1
  S2_PIN        = 2             ' Sensor S2 on P2
  S3_PIN        = 3             ' Sensor S3 on P3
  S4_PIN        = 4             ' Sensor S4

PUB main
  repeat while (ina(S4_PIN) <> 0)' wait for Sensor 4 to trigger

Comments

Sign In or Register to comment.