George Durell
George Durell

Reputation: 25

Adafruit motor hat python3

Iv written a script that uses the adafruit motor hat library to control motors when it recives 433MHz ex transmitted codes! Very short range at the moment however this is the best way for my project!

The problem is the 433MHz rx/tx library is python3 and won't work on python2

And the adafruit_motor_hat_library is pyrhon2 and wont work on pyrhon3?

As I need both of these to work in the same scrip how can I go about this?

Also if I try and run from command line it won't work, (if I python3.scrip.py it brings up error with adafruit motor hat, if I python.script.py it brings up error on 433MHz?

If anybody needs my full scrip I can copy and past it here but as the problem doesn't seem to be with the actual scrip it seemed pretty pointless! But if you need it I can provide it

Upvotes: 2

Views: 328

Answers (1)

TomServo
TomServo

Reputation: 7409

To save time, I would convert the smaller of the two libraries you mention to the other version. If they're about the same size, I'd convert the 2.x library to 3. The motor hat library is only ~350 lines of code, much of which will not change in conversion to 3.x. Would be a good self-teaching exercise...

Upvotes: 1

Related Questions