Step 11Programming the Full Function Controller
Firstly, I need to give credit to John Moxham, who published an instructable that showed how the Picaxe can talk with a PC running a Visual Basic program.
I based much of my design and especially the VB code on his work, see the following link ...
http://www.instructables.com/id/Automate-your-science-experiments/
John's instructable also gives more details on building VB apps over and above the very brief instructions I give below. I built John's complete project before I even started mine - it's what gave me the confidence I could do it.
1. Download the Free Picaxe Programming Editor Software from -
http://www.rev-ed.co.uk/picaxe/
2. Install the software on your PC and connect the serial cable from the Full Function Controller to your PC. Set the Run/PRG switch to PRG, and connect 6VDC power supply.
There are a few initial settings (like Com Port) to be done in Picaxe Programming Editor Software, see the Help menu, especially "Manual 1 - Geting Started."
3. Use the FILE>NEW menu command to open a new window and then copy and paste in the below code:
..............................................................................................................
input 4 ' touch switch equals 0 if touched, else equals 1
b2=1 ' inital variable value for touch switch on/off state: 1 = off ,0= on
main:serin 3,N2400,("Data"),b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13
b2 = pin4
serout 0,N2400,("Data", b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13)
if b2 =0 and b1 = 1 then 'REM b1 is the ready to activte flag set in VB program
b0=3
endif
select case b0 ' determines how to run motor and LED on/off state
case 0
low 1
pwmout 2 OFF ' LEDS and motor both off
case 1
high 1
pwmout 2, 255, 350 ' LEDS on and motor at idle speed geeting ready for activation
case 2
high 1
pwmout 2, 255, 450 ' LEDS on and run motor at medium speed for test run
case 3
high 1
pwmout 2, 255, 700 'LEDS on and motor at full speed in activation & upload mode
else
low 1
pwmout 2 OFF ' LEDS and motor both off
endselect
goto main
........................................................................................................
4. Click the Little Blue Triangle on the menu bar to download the program.
5. If you didn't get an error message during the download you're done.
If you are really stuck at this stage, ask for some help at the Picaxe help forum http://www.picaxeforum.co.uk/
The Full Function controller won't do anything it this point. So just reset the Run/PRG switch to RUN, and disconnect 6VDC power supply & serial cable.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|

















































