Sensor Watch 0.0.2
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
|
This section covers functions related to the bi-color red/green LED mounted behind the LCD. More...
Functions | |
void | watch_enable_leds (void) |
Enables the bi-color LED. | |
void | watch_disable_leds (void) |
Disables the LEDs. | |
void | watch_set_led_color (uint8_t red, uint8_t green) |
Sets the LED to a custom color by modulating each output's duty cycle. | |
void | watch_set_led_color_rgb (uint8_t red, uint8_t green, uint8_t blue) |
On boards with an RGB LED, sets the LED to a custom color by modulating each output's duty cycle. | |
void | watch_set_led_red (void) |
Sets the red LED to full brightness, and turns the green LED off. | |
void | watch_set_led_green (void) |
Sets the green LED to full brightness, and turns the red LED off. | |
void | watch_set_led_yellow (void) |
Sets both red and green LEDs to full brightness. | |
void | watch_set_led_off (void) |
Turns both the red and the green LEDs off. | |
This section covers functions related to the bi-color red/green LED mounted behind the LCD.
The SAM L22 is an exceedingly power efficient chip, whereas the LED's are relatively power- hungry. The green LED, at full power, consumes more power than the whole chip in active mode, and the red LED consumes about twelve times as much power! The LED's should thus be used only sparingly in order to preserve battery life.
make COLOR=BLUE
, and the watch library will automatically swap the pins so that watch_set_led_red sets the red LED, and watch_set_led_green sets the blue one. void watch_disable_leds | ( | void | ) |
Disables the LEDs.
void watch_enable_leds | ( | void | ) |
Enables the bi-color LED.
void watch_set_led_color | ( | uint8_t | red, |
uint8_t | green | ||
) |
Sets the LED to a custom color by modulating each output's duty cycle.
red | The red value from 0-255. |
green | The green value from 0-255. If your watch has a red/blue LED, this will be the blue value. |
void watch_set_led_color_rgb | ( | uint8_t | red, |
uint8_t | green, | ||
uint8_t | blue | ||
) |
On boards with an RGB LED, sets the LED to a custom color by modulating each output's duty cycle.
red | The red value from 0-255. |
green | The green value from 0-255. |
blue | The blue value from 0-255. |
void watch_set_led_green | ( | void | ) |
Sets the green LED to full brightness, and turns the red LED off.
Of the two LED's in the RG bi-color LED, the green LED is the more power-efficient one (~0.44 mA).
void watch_set_led_red | ( | void | ) |
Sets the red LED to full brightness, and turns the green LED off.
Of the two LED's in the RG bi-color LED, the red LED is the less power-efficient one (~4.5 mA).
void watch_set_led_yellow | ( | void | ) |
Sets both red and green LEDs to full brightness.
The total current draw between the two LED's in this mode will be ~5 mA, which is more than the watch draws in any other mode. Take care not to drain the battery.