"""
Pride flags
Display the different pride flags that are part of the pride module.
Use left and right to switch the flags.
"""

import pride
import buttons
import utime

flags = list(pride.flags.keys())
current_flag = 0
pride.show_display(flag=flags[current_flag])

while True:
    utime.sleep(0.1)
    pressed = buttons.read(
        buttons.BOTTOM_LEFT | buttons.BOTTOM_RIGHT
    )

    if pressed & buttons.BOTTOM_RIGHT != 0:
        current_flag = (current_flag + 1) % len(flags)
        pride.show_display(flag=flags[current_flag])

    if pressed & buttons.BOTTOM_LEFT != 0:
        current_flag = (current_flag - 1) % len(flags)
        pride.show_display(flag=flags[current_flag])

    utime.sleep(0.1)