Circuit Python tutorials in Robotics II
View the Project on GitHub MrPrattASH/Robotics-II-Circuit-Python
Let’s get more practice initializing pins for different components on our board. Its best to get the practice of initializing hardware under your belt, as it’s something we’ll be doing A LOT. To do get more practice, lets make a more complex circuit.
You can initialize each button the same, however, you need to have different variable names. Perhaps “green_button” and “blue_button”?
and
operator to check multiple conditions at once in single if statement. For example:
if button_1 and button_2:
# both buttons have been pressed
while True:
if button_1 and not button_2:
# only button 1 is pressed
elif button_2 and not button_1:
# only button 2 is pressed
...