aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2019-07-28 19:19:05 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2019-07-28 19:19:05 -0500
commitf98ff594e4488069e5d08b3a1813fd87d2284093 (patch)
treeaa7fa47f465f7c17efff2afa9b4f642ef1ec4cf8
parentf8a22ef73eb409d460cf4c4c5948b97ca41026a9 (diff)
Adjust ldr brightness from ADC so 0 is max and 3 is min.
-rwxr-xr-xmain.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.c b/main.c
index 72f3761..b7b2a48 100755
--- a/main.c
+++ b/main.c
@@ -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
}