Shop OBEX P1 Docs P2 Docs Learn Events
Flexiforce sensor- output to terminal issue — Parallax Forums

Flexiforce sensor- output to terminal issue

beckerwvbeckerwv Posts: 7
edited 2012-07-15 12:03 in Propeller 1
Hi All,

I am a bit new here and am hoping I can get some help reading the Flexiforce sensor. I am trying to output to the Propeller serial terminal and getting either garbage or '0' every time.
I am using the Propeller Board of Education (BOE) and have it set up like this:
Flexiforce.png



flexiforce.sample2.spin
The code in Flexiforce_Simple2 displays this output:
¬±µµ˜…¬±µµ˜…¬µµµ˜…¨µµµ˜…¬µµ±˜…¬±µµ˜…¨±µµ˜…¬±µµ˜…¨±µµ˜…¬±µµ˜…¬
µµµ˜…¬±µ±˜…¬±µµ˜…¬±µ±˜…¬±µµ˜…¬±µ±˜…¬±µ±˜…¬µµµ˜…¬±µ±˜…¨±µµ˜…¨±µ
µ˜…¬±µµ˜…¨±µµ˜…¬µµµ˜…¬±µµ˜…¬±µµ˜…¬µµµ˜…¬±µµ˜…¨±µµ˜…¬µµµ˜…¬±µ±
˜…¬±µµ˜…¬±µµ˜…¨±µ±˜…¬±µµ˜…


Flexiforce_test.spin
The code in Flexiforce_test displays this output:
TESTING
TIME = 0
TIME = 0
TIME = 0
TIME = 0

I am expecting some sort of number to be displayed. The harder I press the sensor the faster the lines of data are displayed.

I guess I am just missing something simple. :)

Thanks for any help you can give!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-15 11:09
    In flexiforce.sample.spin, you have to have definitions for XINFREQ and CLKMODE as follows:

    CON
    XINFREQ = 5_000_000
    CLKMODE = XTAL1 + PLL16X

    These tell the program what the crystal speed is and how fast you want the system clock to be (80_000_000 is standard ... 5MHz x 16). The default is to use the built in RCFAST clock which is not accurate enough to transmit data to a PC.

    In both programs, you're not calling RCTIME properly. do: RCT.RCTIME( pin, 1, @RCTIMEValueAddress)
  • beckerwvbeckerwv Posts: 7
    edited 2012-07-15 12:03
    Mike,
    That worked!! Thank you so much!!!
Sign In or Register to comment.