i want to buy a TXT at the end of the yeari
i have a problem i see 30%
so using robopro is not a option for realy complex code
so i decided to use python insted
i have some coding experiance
see :
www.libertybasiccom.proboards.com [ bluatigro ]
www.justbasiccom.proboards.com [ bluatigro ]
www.freebasic.net/forum [ bluatigro ]
www.helpmij.nl [ dutch ][ blua tigro ]
www.vbforums.com [ bluatigro ]
www.codeproject.com [ bluatigro ]
www.ai.hcc.nl [ dutch ][ titus ]
i m already buzzy whit python
i already found some info on this site
i have some questions :
how do i active python on the TXT ?
how do i get a program on the TXT ?
can anyone give me a list of instruction's
on how to code a moblie robot ?
Code: Alles auswählen
# bluatigro 18 jun 2018
# mecrano wheel robot remote control
import ftrobopy
import time
txt = ftrobopy.ftrobopy( 'auto' )
motorleftfore = txt.motor( 1 )
motorrightfore = txt.motor( 2 )
motorleftback = txt.motor( 3 )
motorrightback = txt.motor( 4 )
joylow = -.5
joyhigh = .5
def move( a , b , c , d ) :
motorleftfore.setSpeed( a )
motorrightfore.setSpeed( b )
motorleftback.setSpeed( c )
motorrightback.setSpeed( d )
def go( a ) :
move( a , -a , a , -a )
def turn( a ) :
move( a , a , a , a )
def sideway( a ) :
move( a , a , -a , -a )
joystickLeft = txt.joystick( 0 , remote_number = nr )
joystickRight = txt.joystick( 1 )
# remote_number = 0 ( any ) is the default
buttonON = txt.joybutton( 0 )
buttonOFF = txt.joybutton( 1 )
while not buttonOFF.pressed():
joyleftx = joystickLeft.leftright()
joylefty = joystickLeft.updown()
joyrightx = joystickRight.leftright()
joyrighty = joystickRicht.updown()
if ( joyleftx < joylow ) :
sideway( -512 )
elif ( joyleftx > joyhigh ) :
sideway( 512 )
elif ( joyrightx < joylow ) :
turn( 512 )
elif ( joyrightx > joyhigh ) :
turn( -512 )
elif ( joyrighty < joylow ) :
go( -512 )
elif ( joyrighty > joyhigh ) :
if ( txt.ultrasonic( 1 ) > 10 ) :
go( 512 )
time.sleep( 0.04 )
this code was not tested jet !!