You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from curio import sleep
from bricknil import attach, start
from bricknil.hub import PoweredUpHub
from bricknil.sensor import TrainMotor
@attach(TrainMotor, name='motor')
class Train(PoweredUpHub):
async def run(self):
for i in range(2): # Repeat this control two times
await self.motor.ramp_speed(80,5000) # Ramp speed to 80 over 5 seconds
await sleep(6)
await self.motor.ramp_speed(0,1000) # Brake to 0 over 1 second
await sleep(2)
async def system():
hub = Train("My train", ble_id="90:84:2B:03:xx:xx")
if __name__ == '__main__':
start(system)
I just did a clean installation of Python 32bit and Bricknil under Windows 10 1903:
pip install bricknil
...
'Successfully installed bluebrick-Adafruit-BluefruitLE-0.9.13 bricknil-0.9.3 bricknil-bleak-0.3.1 curio-1.2 future-0.18.2 pythonnet-2.4.0 pyyaml-5.3.1'
and tried this sample:
and it didn't work:
The text was updated successfully, but these errors were encountered: