Hardware Reference
In-Depth Information
•
delay()
•
delayMicroseconds()
•
millis()
•
pinMode()
•
digitalWrite()
•
digitalRead()
•
analogRead()
(on pins from A0 to A7—for example, analogRead(5) will read from
A5)
•
shiftIn()
•
shiftOut()
•
attachInterrupt()
•
detachInterrupt()
You can detect
RISING
and
FALLING
interrupts. Any digital pin (from 2 to 13) can be used
in
attachInterrupt()
. For example, if you want to be aware of
RISING
events on pin 6,
you can use
attachInterrupt(6,function_to_call,RISING
).
Enable the UART port
On the Raspberry Pi, make a backup of
/boot/cmdline.txt
and open it for editing:
$ sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt
$ sudo vi /boot/cmdline.txt
Here's what this file contains:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 con
sole=tty1 $
Remove the parameters that reference the UART serial port (
ttyAMA0
) so that it says
only this:
dwc_otg.lpm_enable=0 console=tty1 $
Open
/etc/inittab
and comment out the following line:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Then reboot the Raspberry Pi.