版子上又有多餘的GPIO時,若電流很小(例如驅動一般LED),可以使用GPIO當作VCC/GND
以Leonardo為例,GPIO可以輸出40mA
http://arduino.cc/en/Main/ArduinoBoardLeonardo#.Uym72PmSyXo
Summary
Microcontroller | ATmega32u4 |
Operating Voltage | 5V |
Input Voltage (recommended) | 7-12V |
Input Voltage (limits) | 6-20V |
Digital I/O Pins | 20 |
PWM Channels | 7 |
Analog Input Channels | 12 |
DC Current per I/O Pin | 40 mA |
DC Current for 3.3V Pin | 50 mA |
Flash Memory | 32 KB (ATmega32u4) of which 4 KB used by bootloader |
SRAM | 2.5 KB (ATmega32u4) |
EEPROM | 1 KB (ATmega32u4) |
Clock Speed | 16 MHz |
ex:
pin8: 5V
pin9: 0V
code:
pinMode(8, OUTPUT); pinMode(9, OUTPUT); digitalWrite(8, HIGH); digitalWrite(9, LOW);
沒有留言:
張貼留言