SerialPort.pb;; ------------------------------------------------------------;; PureBasic - SerialPort example file;; (c) Fantaisie Software;; ------------------------------------------------------------; CompilerIf #PB_Compiler_OS = #PB_OS_Windows Port$ = 'COM1' CompilerElse Port$ = '/dev/ttyS0' CompilerEndIf If OpenSerialPort(0, Port$, 300, #PB_SerialPort_NoParity, 8, 1, #PB_SerialPort_NoHandshake, 1024, 1024) MessageRequester('Information', 'SerialPort opened with success') Else MessageRequester('Error', 'Can't open the serial port: '+Port$) EndIf.

Hi, I am trying to write a simple program to control a Mini SSC Interface. It connects to the com port and controls a R/C type Servo motor. All I need to do is send three Charactors 255, 1, X - X being any number between 50 and 200. I put together this code but it does not work. Sorry guys, I have only just started with Purebasic and dont follow it. It iseems to be very compicated to do some simple things. I mean really simple, It takes 5 lines to do this with most other basics.

PureBasic - SerialPort. The Serial port (also know as the RS-232 port) was first created in 1969, and despite its age, it is still widely used in the industry. This page describes serial COM port communication by means of Visual Basic. Purebasic serial port example - Gummo - Single-6ix9ine.mp3. Serial Communication Library, multiple ports simultaneously, thread safe. C++ Builder, Delphi incl.

Tiski chertezh avtokad. I only have two wires connected so I dont need all the handshaking, error checking and fancy bits like APIs and DLLs. I just need to send three charactors to move the servo. Leo leo, this is a good way to guarantee that no-one will want to help you in the future with the below comment. 'I mean really simple, It takes 5 lines to do this with most other basics.

' Other basics do all the thinking for you and you generally pay for it up front or in the long run. And they usually have specialist libraries to do invisibly what Terry Hough just tried to show you and what Droopy offered you as a lib. There is no substitute for learning how to do this yourself and there are other examples on the forum (and elsewhere) with examples you could try. Nobody is going to actually write the program for you. If you ask specific questions, most people will generally respond but I suggest you use the forum search feature with which I found other comms examples, try Terry and Droopy's ideas and visit Purearea.net for resources. Have a nice day. _________________ Amateur Radio, D-STAR/VK3HAF.

Another (slightly more polite) way to say it would be this: Look at the examples given and modify them for your own usage. If you've used other BASIC languages as you've said and you're asking about a somewhat arcane topic like this then you can probably understand and code stuff fairly well. Play with the examples given until you're familiar with how things go and then modify it for what you want. Since you're new to PureBasic you can't be expected to immediately grasp how to do everything. Yes, PB follows a lot of the BASIC rules but it's not like qbasic or others. Take your time, explore.

Come up with some code and then ask for help in parring it down to as few lines as you need. If you don't need handshaking or error checking then remove those bits.

The language is there for you to use. It's quite powerful and there are a lot of good resources and very helpful people and tons of code examples. I'm sure if you give it time you will be able to do what you want with a minimum of fuss. Just a quick thanks for the help. Where I went wrong was trying to send a CHR(0), the first servo ( ID 0 ) is a master servo and needs to be centered first before all the others can be used and as I could not send a Chr(0) I could not acitvate it and the rest did not work. After a bit of playing with the Mini SSC controller I was able to get my original program to work and figured out that the problem was something to do with the CHR(0) but as I could not find any documentation to tell me otherwise so I was not 100% sure, but your posts confirm it for me. I will write a Simple Mini SSC Control Program and post it on the Forum for anyone who wants to play with servos and computer control.

Soplo lavalya svoimi rukami vida. Thanks Again Leo _________________ Regards Leo.