Moving Servos using an Analogue controller

Filipe_rei_123

New Member
Hey, I haven't had the best luck in the past 2 weeks trying to learn how to program my Picaxe 08M2 micro controller to do what I want it and I was wondering if anybody on here could help me out.. I found this cool 3D printed maze game on instructables but it was in arduino and for the last 2 weeks I've been trying to understand the code so I could write my own picaxe version. http://www.instructables.com/id/3D-Printed-Maze-Controlled-by-Your-Android-Device/
 

PhilHornby

Senior Member
I've only skimmed through the instructable, but I would say you'd probably need to use a 20X2, rather than 08M2 - so that you can implement the background read from the HC05/HC06. Without it, I think you'd struggle to respond to the data from the 'phone in a timely manner.

UPDATED: SERIN can't (sensibly) be used at the same time as SERVO/SERVOPOS anyway - (from the manual: The servo pulses are also temporarily disabled during timing sensitive serin, serout, sertxd
and debug commands.
)

I've never used a servo - so can't advise on that aspect...

www.picaxeforum.co.uk/showthread.php?12120-A-Basic-Servo-Tutorial might help.
 
Last edited:

slimplynth

Senior Member
If you call that livin'... :)
haha :) Not sure i've ever used one either, there was a 'cat toy' that could effectively blind everyone in the house, mounted on two servos.. lethal.. cat's loved it for 15 mins (not sure that really counts).. was just searching for HC-05 and HC-06 help.. tend to search "Arduino + (picaxe query)".. for the extra results and confusion too.

Anyway, good luck with the bluetooth and 3D printing; I bought a deltabot for assembly last Feb.. only just got it to print a decent(ish) 150mm square footprint in the past week or so, it's good for 13" height I expect now... also just today finished with php + (Raspberry Pi webserver + HC-06 // Picaxe + HC-05)..

Update: I searched the forum but didn't find the info needed to get the HC-05 paired/connected to the HC-06 slave on the raspberry pi.. below 08M2 code for the HC-05 connected to the picaxe, based on this helpful tutorial - thankfully the bt link seems to be persistent, have cycled power on both picaxe an pi several times and it's fine..


Code:
#no_data
setfreq M32


symbol Rx = C.2
symbol Tx = C.1
symbol BAUD = T38400_32
symbol LED = C.4

main:

high LED

pause 250

low LED 

'debug b0

serout Tx, BAUD, ("AT+RMAAD",13,10)
pause 2000
high LED
serout Tx, BAUD, ("AT+ROLE=1",13,10)
pause 2000
low LED
serout Tx, BAUD, ("AT+RESET",13,10)
pause 2000
high LED
serout Tx, BAUD, ("AT+CMODE=0",13,10)
pause 2000
low LED

'The tutorial linked above states the pin must be the same on both the HC-05 and HC-06.

serout Tx, BAUD, ("AT+PSWD=1234",13,10)
pause 2000
high LED

'you'll want to use your mobile phone or other device to replace the zeros below with the MAC address for the HC-06 slave connected to the rpi3 - keep the commas, no colons required...

serout Tx, BAUD, ("AT+PAIR=00,00,00,00,00,00",13,10)
pause 2000
low LED 'don't be sad - it ends on an high...

serout Tx, BAUD, ("AT+BIND=00,00,00,00,00,00",13,10)
pause 2000
high LED
serout Tx, BAUD, ("AT+LINK=00,00,00,00,00,00",13,10)


End
 
Last edited:
Top