Skip to main content

Posts

Showing posts from February, 2018

Buttons and alarm

Now I have my buttons. And it didn't go smooth sailing.


Before all, let's try to review what I want and how to do that :
I want buttons to control the KaRadio. 6 buttons are enough. We will detail them a bit afterwards.I want my buttons to also set an alarm clock. This should stay visible, and should use the already implemented buttons to be modified and set. I want that any push in a button results in changes that are visible on the LCD screen. If the volume changes, I want to see it. If the station changes, well that's already implemented. First, I went to read the documentation on how to operate the GPIO. I knew I needed only to read digital states of the GPIO. At first, I found this document straight from Maple docs :
http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/libmaple/api/gpio.html
It's quite dense, but there is some information. GPIOs must be initialized with gpio_init(), then you need to set their state to output or input. For me…