Writing own Code for DiddyBorg V2
Forums:
Hi,
I have built and setup my DiddyBorg v2 and all of the example programs work fine, however when I write my own code in python, and run simple functions, I am getting 'Failed sending motors off command!', etc. Could someone shed some light on this issue please as I am using this as part of my A-Level coursework! I feel as though this is something to do with the fact that I am writing .py files, and executing them using sudo python filename.py in the terminal, as using IDLE throws up completely different errors.
Thanks!
Henry
piborg
Sun, 11/26/2017 - 17:00
Permalink
ThunderBorg not fully setup?
It might be hard to figure this out without seeing your code, but if I had to guess my first thought is that you have missed out the
TB.Init()
call before trying to set motor speeds.This is a stripped down example which should do the minimum needed to setup the ThunderBorg and then command the motors to stop:
HenryB
Mon, 11/27/2017 - 10:47
Permalink
Doh!
Works perfectly now - silly me! Thanks for the super-quick help!
Out of interest, is running the code in Python 3 IDLE a no-go?
Thanks
piborg
Mon, 11/27/2017 - 13:01
Permalink
Running with Python 3
IDLE should be fine, however the standard
ThunderBorg.py
script only works with Python 2.You can get a Python 3 compatible version from this post: ThunderBorg script for Python 3.