Playing with Arduino
A page to record my playing with Arduino
PIN

Abstract

PINは、デジタルピンの入出力を行うためのレジスタです。PINBとPINC、PINDの3種類あります。

PINs are registers to control digital I/O. There are PINB, PINC and PIND.

Source Code

PINB, PINC and PIND are defined in hardware/tools/avr/avr/include/avr/iom328p.h as below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#define PINB _SFR_IO8(0x03)
#define PINB0 0
#define PINB1 1
#define PINB2 2
#define PINB3 3
#define PINB4 4
#define PINB5 5
#define PINB6 6
#define PINB7 7

#define PINC _SFR_IO8(0x06)
#define PINC0 0
#define PINC1 1
#define PINC2 2
#define PINC3 3
#define PINC4 4
#define PINC5 5
#define PINC6 6

#define PIND _SFR_IO8(0x09)
#define PIND0 0
#define PIND1 1
#define PIND2 2
#define PIND3 3
#define PIND4 4
#define PIND5 5
#define PIND6 6
#define PIND7 7

0x03, 0x06, 0x09 are I/O address of PINB, PINC and PIND respectively. They are macros to call _SFR_IO8().

Version

Arduino 1.8.13/avr-gcc 7.3.0-atmel3.6.1-arduino

Last Update

June 19, 2020

inserted by FC2 system