diff options
author | William Harrington <kb0iic@berzerkula.org> | 2019-07-28 19:19:05 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2019-07-28 19:19:05 -0500 |
commit | f98ff594e4488069e5d08b3a1813fd87d2284093 (patch) | |
tree | aa7fa47f465f7c17efff2afa9b4f642ef1ec4cf8 | |
parent | f8a22ef73eb409d460cf4c4c5948b97ca41026a9 (diff) |
Adjust ldr brightness from ADC so 0 is max and 3 is min.
-rwxr-xr-x | main.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -131,7 +131,7 @@ int main() { ldr = Adc_Read(0);
if (ldr_chg != ldr) {
- Vfd_Set_Brightness(1024 / ldr);
+ Vfd_Set_Brightness(3 - ((1024 / ldr) - 1));
ldr_chg = ldr;
}
@@ -151,9 +151,9 @@ int main() { sprintf(buf, "%sWKDAY:%s\t%d\t\t%sDAY:%s\t%s\r\n", YELLOW, CLRATTR,
dayOfWeek, YELLOW, CLRATTR, weekday);
UART_send_string(buf);
- sprintf(buf, "%sTEMP:\t%s%c%c%c.%c%cC%s\t\t%sLDR:%s\t\%d\r\n",
+ sprintf(buf, "%sTEMP:\t%s%c%c%c.%c%cC%s\t\t%sLDR:%s\t\%04d %d\r\n",
YELLOW, CLRATTR, temp_sign, temp_2, temp_1, temp_0, 0xB0,
- CLRATTR, YELLOW, CLRATTR, ldr);
+ CLRATTR, YELLOW, CLRATTR, ldr, ((3 - (1024 / ldr))) - 1);
UART_send_string(buf);
#endif
}
|