This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
digispark:quickref [2014/02/07 17:48] digistump |
digispark:quickref [2014/12/29 09:01] joelparks bugfix result computation |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| - | * GPIO output is 20 mA max, same as a regular Arduino. | + | * GPIO output is 20 mA max per pin, same as a regular Arduino. |
| * I2C pins are Pin 0 (I2C data/SDA) and Pin 2 (I2C clock/SCL). | * I2C pins are Pin 0 (I2C data/SDA) and Pin 2 (I2C clock/SCL). | ||
| * USB communication uses pins #3 and #4. Using these pins for your circuit can interfere with the USB interface, e.g. reprogramming the Digispark. So it’s a good idea to provide some sort of disconnect ability if you use either of these two pins. | * USB communication uses pins #3 and #4. Using these pins for your circuit can interfere with the USB interface, e.g. reprogramming the Digispark. So it’s a good idea to provide some sort of disconnect ability if you use either of these two pins. | ||
| Line 13: | Line 13: | ||
| * USB connector takes 5v (4.5-6v may work but not supported) | * USB connector takes 5v (4.5-6v may work but not supported) | ||
| * Pin 3 has a 1.5K pull-up (for USB communications) | * Pin 3 has a 1.5K pull-up (for USB communications) | ||
| + | * Pin 5 has some limitations it cannot handle as much current is outputs more like 3.6v - but works fine for most non-current sourcing uses | ||
| **analogRead** | **analogRead** | ||
| Line 102: | 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 | ||