I'm working with lightblue bean. I have a device that writes data to an SD card on a long button press and switches what will be written (from a list of 5 items) on short button press.
The output, printed both to the SD card and to serial looks like this:
12:38, 7/15/15, subway
12:55, 7/15/15, subway
12:38, 7/15/15, bus
12:55, 7/15/15, rail
etc. It's basically a time stamp then a vale from this list:
char* modes[]= {"walking", "subway", "bus", "railroad", "other"};
This works perfectly. But the bean has very few pins:
- 5 SCK -- connected to SD card.
- 4 MISO -- connected to SD card.
- 3 MOSI -- connected to SD card.
- 2 SS -- connected to SD card.
- 1 -- input button, takes long and short presses
- 0 --
- A1 SDA --- connected to real time clock for timestamp
- A0 SCL --- connected to RTC (real time clock) for timestamp
I have one free DIGITAL pin. I need to let the user know what they have selected. This could be done with 5 LEDs that light up next to the user's choice, or maybe displayed text? This is a portable item so a servo that points to the user's choice might be too unreliable.
I've done some research into shift registers. They all seem to need 3 digital pins min. If I could do it with 2 I could rework the button...
Ideas?