Hi Dr Charbonneau
I am posting to comp.robotics.misc
I used the k8055 simply because I could walk into the shop and buy it as I don't like buying sight unseen without retailers to talk to. I used to interface via the parallel port on the old computers but now you have to use a USB port or a wireless connection.
formatting link
If you want vision then RoboRealm might be an easy solution and they also have robot examples.
formatting link
I am not sure what kind of robot you want to start with? Another robot I can just walk in and buy is based on the Arduino.
formatting link
formatting link
You might also like to look at the Raspberry Pi
I actually use FreeBasic because as a hobby programmer BASIC and assembler were my first languages and easy to use and learn. I also used to use C a lot before FreeBasic. FreeBasic comes with an inline assembler. I used assembler a lot in the old days but find with the modern fast computers and sophisticated compilation of HLLs means it isn't really required.
This is a simple FreeBasic code demo using a wireless keyboard to remote control the motors on the robot base to give you some idea of how to use the k8055. I hasten to add it may not be the best solution for you, it was just all I had at the time.
formatting link
Dim OpenDevice As Function (Byval CardAddress As Long) As Long Dim CloseDevice As Sub Dim SetAllDigital As Sub Dim ClearAllDigital As Sub Dim SetDigitalChannel As Sub (Byval As Integer) Dim ClearDigitalChannel As Sub (Byval As Integer)
Dim hndl As Any Ptr
hndl=DyLibLoad("k8055d.dll")
'' find the procedure address (case matters!) OpenDevice = DyLibSymbol( hndl, "OpenDevice" ) CloseDevice = DyLibSymbol( hndl, "CloseDevice" ) SetAllDigital = DyLibSymbol( hndl, "SetAllDigital" ) ClearAllDigital = DyLibSymbol( hndl, "ClearAllDigital" ) SetDigitalChannel = DyLibSymbol(hndl, "SetDigitalChannel") ' (Byval As Integer) ClearDigitalChannel = DyLibSymbol(hndl, "ClearDigitalChannel")
'' then call it.. Print "opening" OpenDevice(0) Print "opened"
dim as string key dim as integer motor1 = 0 'motor off=0 motor on = 1 pin1 dim as integer direction1 = 0 'direction left or right pin2
do key = inkey 'turn motor1 left or right? if key = "1" then ClearDigitalChannel(1) 'turn motor off sleep 10 'time to settle ClearDigitalChannel(2) 'direction left sleep 10 'time to settle SetDigitalChannel(1) 'turn on motor sleep 100 'time to run ClearAllDigital() end if if key = "2" then ClearDigitalChannel(1) 'turn motor off sleep 10 'time to settle SetDigitalChannel(2) 'direction right sleep 10 'time to settle SetDigitalChannel(1) 'turn on motor sleep 100 ClearAllDigital() end if 'turn motor2 left or right? if key = "3" then ClearAllDigital() 'turn motors off sleep 10 'time to settle ClearDigitalChannel(4) 'direction left sleep 10 'time to settle SetDigitalChannel(3) 'turn on motor sleep 100 'time to run ClearAllDigital() end if if key = "4" then ClearAllDigital() 'turn motors off sleep 10 'time to settle SetDigitalChannel(4) 'direction right sleep 10 'time to settle SetDigitalChannel(3) 'turn on motor sleep 100 ClearAllDigital() end if 'rotote left if key = "l" then ClearAllDigital() 'turn motors off sleep 10 'time to settle ClearDigitalChannel(4) 'set direction left SetDigitalChannel(2) 'set direction right sleep 10 'time to settle setDigitalChannel(1) 'turn on motor1 SetDigitalChannel(3) 'turn on motor2 sleep 100 'time to run ClearAllDigital() end if 'rotate right if key = "r" then ClearAllDigital() 'turn motors off sleep 10 'time to settle SetDigitalChannel(4) 'set direction right ClearDigitalChannel(2) 'set direction left sleep 10 'time to settle setDigitalChannel(1) 'turn on motor1 SetDigitalChannel(3) 'turn on motor2 sleep 100 'time to run ClearAllDigital() end if 'rotate right if key = "b" then ClearAllDigital() 'turn motors off sleep 10 'time to settle SetDigitalChannel(4) 'set direction right SetDigitalChannel(2) 'set direction left sleep 10 'time to settle setDigitalChannel(1) 'turn on motor1 SetDigitalChannel(3) 'turn on motor2 sleep 100 'time to run ClearAllDigital() end if 'rotate forward if key = "f" then ClearAllDigital() 'turn motors off sleep 10 'time to settle ClearDigitalChannel(4) 'set direction right ClearDigitalChannel(2) 'set direction left sleep 10 'time to settle setDigitalChannel(1) 'turn on motor1 SetDigitalChannel(3) 'turn on motor2 sleep 100 'time to run ClearAllDigital() end if loop until key="s"
'now shut down the device Print "closing" CloseDevice () Print "closed" DyLibFree hndl
end