Shop OBEX P1 Docs P2 Docs Learn Events
Pan / Tilt code bug — Parallax Forums

Pan / Tilt code bug

BotdocterBotdocter Posts: 271
edited 2010-12-19 13:59 in Propeller 1
I have this code attached. It is used for communication with roborealm. it receives 2 values that are coverted to servo width. one for the pan and one for the tilt. The tilt is working as should. But the Pan servo is not moving at all. it is powered and held into place so i can't move it manually.

Any help is welcome!!!RRSerial.zip

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-12-17 09:49
    There doesn't seem to be anything wrong with your code. Make sure the pan servo is connected to the I/O pin you've given in your code. Have you looked at the data coming from the PC? Is it correct? It would be easy for the PC and the Propeller to get out of sync. Of course then the tilt servo wouldn't work properly, but I'd use a more robust signalling mechanism, something with some error detection in it. One option could be to send the data twice ... two bytes in a row with the identical information ... and compare them on the Propeller end. Another option would be to invert the 2nd copy, send the data, then send (256 - data) and add them on the Propeller end (and check for 256).
  • BotdocterBotdocter Posts: 271
    edited 2010-12-17 13:38
    Thank you for your reply. i'm glad the code should be working.

    I indeed share your idea that the serial connection is kinda fragile. But the solutions you gave me are way over my head. I wrote this code with help of another member.

    if you are known with robrealm; this is what is send:

    \\value1\\value2\\value3\\value4

    and it is received by the propeller as:
    \\value4\\value3\\value2\\value1

    value1 is in the correct place according to the above,though, the other values are an assumption
  • BotdocterBotdocter Posts: 271
    edited 2010-12-19 13:09
    Can anyone help me out? I'm falling and i can't get up!!!
  • hover1hover1 Posts: 1,929
    edited 2010-12-19 13:36
    Botdocter wrote: »
    Can anyone help me out? I'm falling and i can't get up!!!

    I don't think there are too many people here that are involved with RoboRelm. That may be why you are not getting an answer. After all this is a Parallax forum and you are asking questions for another vendor

    Have you asked in the Roborealm forums:

    http://www.roborealm.com/forum.php

    Jim
  • Mike GreenMike Green Posts: 23,101
    edited 2010-12-19 13:59
    Just as a word of general advice ...

    It's usually a bad idea for a beginner to try to combine the products of two different manufacturers unless both products are sold by one of the manufacturers or unless you're working through a dealer that handles both products. In this case, you're trying to combine a Propeller with RoboRealm. That's fine when things work as they usually do. When they don't work though, you will have a hard time if you don't understand at least the basics of how each product works and how they should connect together.

    As I mentioned, there doesn't seem to be anything fundamentally wrong with your Propeller code. I assume that RoboRealm is working, but I (and most people here) have no experience with RoboRealm. Maybe there's some kind of assumption in the communications that's wrong. Maybe you can get enough help from the RoboRealm forum to figure that out.
Sign In or Register to comment.