arduino:arduino_crash_course:misc
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
arduino:arduino_crash_course:misc [2015/02/16 03:46] – [Most preferred pins] mithat | arduino:arduino_crash_course:misc [2015/02/16 04:22] (current) – [Serial communication] mithat | ||
---|---|---|---|
Line 29: | Line 29: | ||
This leaves: | This leaves: | ||
- | * **Binary | + | * **Digital |
* **PWM out:** 9, 10, and 11; pins 5 and 6 have higher-than-expected duty cycles. | * **PWM out:** 9, 10, and 11; pins 5 and 6 have higher-than-expected duty cycles. | ||
- | * **Analog or binary | + | * **Analog or digital |
Note that pin 13 also has a pullup resistor on it for the internal LED, meaning it's a poor choice for use as an input even if you're not using SPI. | Note that pin 13 also has a pullup resistor on it for the internal LED, meaning it's a poor choice for use as an input even if you're not using SPI. | ||
Line 42: | Line 42: | ||
==== Output ==== | ==== Output ==== | ||
- | === Binary | + | === Digital |
* Output is limited to 40mA. More current draw can destroy the chip. | * Output is limited to 40mA. More current draw can destroy the chip. | ||
* There are no output resistors. | * There are no output resistors. | ||
Line 83: | Line 83: | ||
==== Input ==== | ==== Input ==== | ||
- | === Binary | + | === Digital |
* " | * " | ||
* Internal pullup resistors are disabled by default. | * Internal pullup resistors are disabled by default. | ||
Line 127: | Line 127: | ||
int ANALOG_PIN = 3; // Maps to A3 we think. | int ANALOG_PIN = 3; // Maps to A3 we think. | ||
int val = 0; | int val = 0; | ||
- | |||
- | ... | ||
void loop() { | void loop() { | ||
Line 136: | Line 134: | ||
+ | ---- | ||
+ | |||
+ | ===== Serial communication ===== | ||
+ | |||
+ | * Serial I/O consumes pins 0 (for RX) and 1 (for TX) if used. | ||
+ | * [[http:// | ||
+ | |||
+ | ==== Serial output ==== | ||
+ | |||
+ | Simple reporting: | ||
+ | <code c> | ||
+ | void setup() { | ||
+ | Serial.begin(9600); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | Serial.write(65); | ||
+ | Serial.print(42); | ||
+ | Serial.println(" | ||
+ | Serial.print(78, | ||
+ | Serial.println(1.23456, | ||
+ | Serial.end(); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Serial output ==== | ||
+ | Later. | ||
+ | |||
+ | |||
+ | ---- | ||
arduino/arduino_crash_course/misc.1424058416.txt.gz · Last modified: 2015/02/16 03:46 by mithat