This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
digispark:quickref [2014/02/07 18:06] digistump |
digispark:quickref [2014/12/29 09:01] (current) joelparks bugfix result computation |
||
|---|---|---|---|
| Line 103: | Line 103: | ||
| uint8_t high = ADCH; // unlocks both | uint8_t high = ADCH; // unlocks both | ||
| - | long result = (high<< | low; | + | long result = (high<<8) | low; |
| result = 1125300L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000 | result = 1125300L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000 | ||