Getting started
Make sure to install the TLOB library by copying the library files to your Arduino library folder/TLOB
Connect 3 leds 1 button to your arduino, one end connects to arduino pins and the other end to ground.
Then copy the template below and replace the pin numbers: tlob(led1, led2, led3, button)
Now upload the code to your arduino, and hold press the button to check if all leds light up.
#
update()It is recommended to call tlob.update();
once per loop, this will make sure that button variables are processed as expected and that blink functions will work correctly. Alternatively you can call tlob.updateLeds()
and 'tlob.updateButton()` separately.
#
FunctionsThe TLOB library comes with a few functions and variables to make programming 3L1B games easier. It is recommendable to have a look at led(), blink() and buttonPressed() to begin with, but the other functions will surely be useful to you too.