Jump to content

Exi

Members
  • Posts

    9
  • Joined

  • Last visited

About Exi

  • Birthday 01/01/1991

Profile Information

  • Location
    Swe

Exi's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Im using Parallax USB servo controller. I was wondering if you guys know any distance sensor that would work together with the servo controller.
  2. <3 Finally working, thanks alot for the help picaxe and martin.
  3. Well that sure made it move, a lil to far tho hehe. It tried to move more than it could and keept trying, had to shut the power of eventually.
  4. Battery just died, will report back after recharge
  5. Thanks for your reply martin. I tried everything you changed and it didnt work either and im pretty sure it have to be "!SC" and not '"!SC"', i tried both tho. I decided to download Portmon and see what the program from the official site do. the above numbers is my program with these settings CODE$Starting = "!SC" $Cpara = "1111" $Rpara = "0111" $Lowbyte = "1250" $Highbyte = "1250" _CommSendString($Starting & ' ' & $Cpara & ' ' & $Rpara & ' ' &$Lowbyte & ',' & $Highbyte & @CR, 1) and below numbers is the program made by parallax which works to move it. As you can see the numbers is not even close to be the same 21 53 43 = !SC Here is an example from manual too, not autoit tho .... CODE'{$PBASIC 2.5} ch VAR Byte pw VAR Word ra VAR Byte Sdat CON 15 baud CON 396 ra = 7 ch = 15 DO pw = 1250 SEROUT Sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR] PAUSE 1000 pw = 250 SEROUT Sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR] PAUSE 1000 LOOP
  6. Hi, i need a little help here with sending to a COM port. I use martins UDF for a servo controller and a servo, i have connected and received version from the controller by using _CommSetPort, _CommSendString, _CommGetString. So there is no problem communicating with it, however i want to move the servo now but i have no idea what to send it. I have tried this but it doesnt move at all. $Starting = "!SC" $Cpara = "15" ;servo is on spot 15 on the controller $Rpara = "7" ;movement speed set to 7 $Lowbyte = "1011" $Highbyte = "1011" _CommSendString($Starting & $Cpara & $Rpara & $Lowbyte & $Highbyte & @CR, 1) Sleep(500) FileWriteLine($file, "" &_NowTime() &"Servo position moved to " & $Lowbyte) Here is some info from the manual. Syntax: !SC C R pw.LOWBYTE, pw.HIGHBYTE, $0D CODESyntax: !SC C R pw.LOWBYTE, pw.HIGHBYTE, $0D Reply: none To control a servo, you must write a position command to the PSC. Each position command is comprised of a header, three parameters: C, R, and PW, and a command terminator. The Header: !SC is the header. The header signifies to all devices on the same wire that this is a command for a Servo Controller. The C parameter is a binary number 0-31 corresponding to the servo channel number. The servo channel number should be 0-15 The R parameter is a binary number 0 63 that controls the ramp function for each channel. If the ramp parameter is set to 0, ramping is disabled and the pulse width will be set to the P parameter sent immediately. Ramp values of 1-63 correspond to speeds from ¾ of a second up to 60 seconds for a full 500 μs to 2.50 ms excursion for standard servos. This correlation is rather linear though no equation presently exists. The P parameter is a 16-bit Word that corresponds to the desired servo position. The range, (250-1250), corresponds to 0 to 180 degrees of servo rotation with each step equaling 2 μs. The command terminator, $0D, (CR), must not be omitted.
  7. Thanks for the udf, works great. I have a problem here with my servo controller and servo from parallax... well actually i have no idea how to change position on the servo. i connect and ping it fine but i have no idea what to send it to change position. I tried this $Starting = "!SC" $Cpara = "15" ;servo is on spot 15 $Rpara = "7" ;movement set to 7 $Lowbyte = "1011" $Highbyte = "1011" _CommSendString($Starting & $Cpara & $Rpara & $Lowbyte & $Highbyte & @CR, 1) Sleep(500) FileWriteLine($file, "" &_NowTime() &"Servo position moved to " & $Lowbyte)oÝ÷ Ù8^·W(!¶Ì!zx¬zwbµ»­×hzÉíÞêÞË(è§~ë¢kazf§¹©ZºÚ"µÍÞ[^$ÉÌÌÎÔÐåÈËÕÐUKËQÒUK ÌÍÌNÛBÈÛÛÛHÙË[ÝH]ÝÜ]HHÜÚ][ÛÛÛ[X[ÈHÐËXXÚÜÚ][ÛÛÛ[X[ÈÛÛÙYÙHXYYH[Y]ÎË[Ë[HÛÛ[X[Z[]ÜHXY$ÉÌÌÎÔÐåÈHXYHXYÚYÛYYÈÈ[]XÙÈÛHØ[YHÚH]ÈÈBÛÛ[X[ÜHÙÈÛÛÛHÈ[Y]ÈH[H[XLÌHÛÜÜÛ[ÈÈHÙÈÚ[[[XHÙÂÚ[[[XÚÝ[HLMBH[Y]ÈH[H[X% È]ÛÛÛÈH[[Ý[ÛÜXXÚÚ[[YH[[Y]ÈÙ]È[[ÈÈØXY[H[ÙHÚYÚ[HÙ]ÈH[Y]Ù[[[YYX][K[[YÈÙKMÈÛÜÜÛÈÜYYÈÛH/ÙHÙXÛÛÈ ÙXÛÛÈÜH[L ÎMMÜÈÈLÈ^ÝÚ[ÛÜÝ[ÙÜËÈÛÜ[][ÛÈ][XÝYÚÈ]X][ÛÙ[H^ÝËH[Y]ÈHMX]ÛÜ]ÛÜÜÛÈÈHÚYÙÈÜÚ][ÛH[ÙK LLLL KÛÜÜÛÈÈÈNYÜYÈÙÙÈÝ][ÛÚ]XXÚÝ]X[[È ÎMMÜËHÛÛ[X[Z[]Ü ÌÍÌ ÔK]ÝÝHÛZ]Y Sorry if this is the wrong place to ask.
  8. It works! Thanks alot
  9. Im new to this and im stuck now. I want it to loop until this color appears and press on it Do $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xE27907) If IsArray($coord) Then MouseClick("left", $coord[0], $coord[1], 1, 1) EndIf Until I cant figure out what to put after Until. Thanks.
×
×
  • Create New...