Metadata-Version: 2.1
Name: bitctrl
Version: 0.0.4
Summary: Turn your microbit into a controller
Home-page: UNKNOWN
Author: momea007
Author-email: momea007@hotmail.com
License: MIT
Keywords: microbit
Platform: UNKNOWN
Description-Content-Type: text/markdown
Requires-Dist: pyserial
Requires-Dist: keyboard

# bitctrl
## IMPORTANT:
TO USE THIS WITH MICROBIT, YOUR MICROBIT WILL HAVE TO TURN THIS PYTHON SCRIPT INTO A .hex FILE AND INSTALL IT ON TO YOUR MICROBIT:
``` serial.redirect_to_usb()
 def on_forever():
     if input.button_is_pressed(Button.AB):
         while input.button_is_pressed(Button.AB):
             serial.write_line("A")
             pause(15)
     if input.button_is_pressed(Button.A):
         while input.button_is_pressed(Button.A):
             serial.write_line("A")
             pause(15)
     if input.button_is_pressed(Button.B):
         while input.button_is_pressed(Button.B):
             serial.write_line("B")
             pause(15)
 forever(on_forever) ```
## EXAMPLE CODE/HOW TO USE IT:
If you plan on using this in pygame, your milliseconds in "pause" should be half of that number,
and then half of that number; so if you have 60 fps in pygame, you divide that by two, so 30, then divide
30 by two, which is 15 - hence why I have it pausing for 15 milliseconds


When bitctrl returns something, like 'B', it sends back the string 'B' which you can use for other stuff in your main script(s). Example:

```from bitctrl import Bitctrl
    while True:
        bitctrl = Bitctrl.bitctrl('a','b','c')
        if bitctrl == 'B':
            print("epic") ```


