Shop OBEX P1 Docs P2 Docs Learn Events
Servo Input, obex, is not cooperating — Parallax Forums

Servo Input, obex, is not cooperating

Hi
It's been a few years, but here I go again.
I downloaded from the OBEX, Servo Input by David C. Gregory.
I wired the RC Servo Receiver I have into my QuickStart board.
I cannot get it to display anything.
My Transmitter is turned on and I get an LED on the receiver saying it should be working.
My end game here is to find center position on my XQ servo which should be 1500uSec.
..
The Servo Input Demo requires the use of ServoInput, vga_text and Numbers objects which I downloaded
and placed them all in the same directory.
..
It is very likely that I don't understand something very basic.
I'm trying to use the Parallax Serial Terminal to display the pulselengths, but that also
does not appear to cooperate.
..
I'll attempt to attach the zip file that I downloaded from OBEX.
It appears that the zip files will be here.
I know I'm being quite vague here.
Maybe a question or two from someone who might be familiar with situations like this
would help me to elaborate in a more understandable manner.
..
Thanks in advance for any words of wisdom, questions, etc.
Garyg



Comments

  • Judging by your statement that the program uses vga_text.spin, I would say that the program needs you to hook up an external VGA monitor. I will read over the code and see what you might want to do about that.
  • Alright, looking at the code for ServoInput_DEMO.spin, I see that it initializes vga_text.spin with start pin 16 this is done at code line 33. the statement is " text.start(16)"
    PUB start | counter
        
      num.init 
      text.start(16)
      read.start(@pins,4,@pulseWidths)
    
    If you have a Propeller Board of Education, as I do, you will want to change this line to say "text.start(8)". then gather eight of those little nifty breadboard wires and connect the following pins(between Propeller I/O and the dual-row socket in the middle of the board):
    P8-V
    P9-H
    P10-B0
    P11-B1
    P12-G0
    P13-G1
    P14-R0
    P15-R1
    Then connect a VGA monitor to the port on the left side of the board and run the code.
  • Using the PST, you need to use parallax_serial_terminal.spin. After you said "it's been years", however, I would advide not trying to tie in PST just yet.
  • Thanks AwesomeCronk.
    Your three responses to my troubles helped very much.
    Usually I can get some type of functioning when working with OBEX objects.
    My microcontroller skills are more than a bit rusty, but I do keep going once I've started.
    The only microcontrollers I have at the moment are a couple of RevA Quickstart boards and a Prop Mini.
    I do also have a couple of Parallax LCD displays- 2 line that I've used in the past.

    I'm thinking that I picked something from OBEX that sounded simple, but for my situation is not.
    Now that I know about the VGA thing, maybe I can do something that will work out for my situation.


    It seems that it should not be very difficult to measure incoming pulse width and display it in microseconds.


    I will revisit the OBEX to see if there is a simpler situation that I can use.

    Thank you very much for your efforts in helping.
    Garyg


  • Changing code to fit hardware, I understand that. I will look at the demo later today and see if I cannot convert it to use the serial lcds. I find them easier to use than the PST.
  • Hi
    Looking through OBEX I found another pulse measuring code.
    It's called PulseTimeTapA.spin
    I put it on my Quick Start board, connected my radio receiver.
    I get an output on the PSC showing that the pulse duration is 14121uSec.
    This pretty much makes sense, but that pulse duration does not
    appear to change no matter where my radio steering wheel is positioned.
    I think it should be changing as I rotate the steering wheel.
    I'll try to attach what I'm using.
    Maybe the code does not work the way I'm thinking it should.
    Any comments would be greatly appreciated.
    ..
    I still need to center my XQ servo at 1500uSec.
    I cannot rotate the shaft by hand, as it is geared very low internally.



  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2019-07-15 22:14
    Gary, I think I got it.
    DISCLAIMER: I have no way of testing this, so I have not done so. This code is raw, untested Spin.
    I have set this up with an LCD on pin 0, at 19200 baud. There is also an LED set up on pin 1. If this LED starts blinking, something is wrong with the LCD init code and one of us screwed it up.

    The pin usages and baud rates can be adjusted in the main CON block, and you don't NEED the LED. Just make sure it is on a pin that is unused otherwise. My code should activate the backlight on the LCD.
    Let me know if there are issues and I will do my best to fix them. Attached are my modified demo and the chain of lcd programs, in case you lack them.
  • Thanks AwesomeCronk
    I'll try this tonight on my QuickStart and Parallax LCD.
    I'll post again with result.
    Garyg
  • I set up my Quickstart and LCD
    Things don't work as I had hoped.
    In the ServoInput_DEMO_for_LCD.spin
    I don't see where the LCD is initialized.
    What happens is this.
    LCD place marker is displayed.
    After about 4 or 5 seconds, I can see some activity on the bottom of the second line
    But I really have to hunt for it. It's like fast oscillating _
    Then after about another 5 or 10 seconds the LCD place marker is displayed.
    No other activity happens.

    ..
    In the past, whatever I did with the LCD's, I always used
    the FullDuplexSerial.spin object.
    If I remember correctly, one of the Parallax guys had told me that Simple Serial
    would not work with my LCD's. I followed his instructions and everything worked.
    I've used that setup every time I used my LCD's without trouble.

    The following is exactly what I've used in the past to get the LCD to cooperate.
    In my test rig, Pin 8 is the TxPin.
    I don't remember the significance of "Motor1" or "Motor2".
    They were from one of my projects 10 years or more ago.


    LCD.start(TxPin, TxPin, %1000, 9_600)
    WaitCnt(ClkFreq / 100 + Cnt) ' Pause to initialize
    LCD.tx(12) ' Clear
    LCD.tx(17) ' Turn on backlight
    LCD.str(String("Motor1")) ' First line
    LCD.tx(13) ' Line feed
    LCD.str(String("Motor2")) ' Second line
    LCD.tx(212) ' Set quarter note
    LCD.tx(220) ' A tone
    'WaitCnt(ClkFreq * 3 + Cnt) ' Wait 3 seconds
    LCD.tx(18) ' Turn off backlight

    ..
    AwesomeCronk, What do you think?
    Or anyone else who would like to chime in.
    Garyg

  • I think the 8Hz loop is too fast for the LCD to refresh. If the light did not come on(led on pin 1), then the lcd definitely initialized. The code I have is used in the Serial LCD docs.(I think) Jeff Martin was one of the authors of Debug_lcd.spin, and I have used it before. It is a “wrapper” which interfaces on a higher level with the serial object. Debug_lcd uses Simple_numbers and Serial_lcd. Serial_lcd uses simple_serial. It works some how through the magic of spin.

    Posting from an iPhone, tomorrow, I will try to make the code read twice in a loop, then drop the loop frequency to 4Hz instead of 8Hz.
Sign In or Register to comment.