As promise last week, I am going to share another project using MC40A + SKPS. The above photo show the combination of Wireless PS2 + SKPS + MC40A ready with the accessories (motors, wheels, base, castor and battery)
Here is another one, just the wireless PS2 become wired PS2, the wire might get tangle around and affect the mobile robot navigation.
Basically, it uses same component in the previous sharing, Yet, Another Line Following Robot!, add SKPS, get your favorite PS2 Joystick (Wired or Wireless) then we are ready. Oh, forgot to mention, I did changed the small motor, SPG10, from 150K to 30K in this version. It moves faster 🙂
The wheels still maintain the 46x10mm mini wheel, fit nicely into the SPG-10 shaft!
So let’s get started. If you have get yourself the complete component as listed, assemble it to get a mobile robot with battery. You may refer to previous sharing here.
I will talk about Wireless PS2 only as the wired PS2 is the same just with extra wire, right? The sample source code can be downloaded here (MC40A 887+SKPS). Load the sample code to MC40A, the sample is written for PIC16F887 only, for PIC16F877A user, sorry 🙂 ! You are welcome to modify the source and share it. Do let us know if you have problem, discuss it at our technical forum here: http://forum.cytron.com.my
OK, if you are done program the MC40A with sample code provided, plug the SKPS onto MC40A as shown.
Switch on the power of MC40A, you should see the LCD putting message “Cytron Tech” which will hold for around 1 second and change to “Demo SKPS” and it will wait for PS2 to be connected to SKPS, since we have connected both this earlier, it will skip the message of “Connect PS2”. It will display “PS2 detected” for 2 second and “Press START” and hold. If you are using wireless PS2, you will need to power on the PS2 Joystick as shown here:
Actually the sample is being written to wait for “Start” button on PS2 to be press before you can do anything 🙂 So please press it before you start! See it? The |> button on the right, top on right joystick. Hope you get it.
If the MC40A detected the Start button, the LCD will display “PS2 Connect!”, now you are ready to control it. Let’s see what the control button and what is the action
Left Joystick will control the mobile robot direction, while the right Joystick controls the speed. The “Cross” will break the communication and go back to the beginning of step. “Circle” and “Square” will activate the vibrator motor on PS2 itself. So have fun with it.
Asides from the locomotion, you can also active the buzzer as car “Horn”, pressing any button of the front panel, R1, R2, L1 and L2 will activate the buzzer.
So that’s all! Hope you have fun with it and here is the video: