回答編集履歴

1

追記

2020/03/21 09:05

投稿

thkana
thkana

スコア7647

test CHANGED
@@ -35,3 +35,53 @@
35
35
  pins_arduino.hとMCP4922.hとの間に不整合というかシンボルの衝突が起きている、ということのような。
36
36
 
37
37
  MCP4922.hでMCP4922::MCP4922()の宣言を行っている部分のint SCKの変数名を変えてやる必要があるのではないでしょうか。
38
+
39
+
40
+
41
+ ---
42
+
43
+ ファイル内容確認しました。
44
+
45
+
46
+
47
+ packages\ATTinyCore\hardware\avr\1.3.3\variants\tinyX5/pins_arduino.hでは
48
+
49
+ ```C++
50
+
51
+ #define SS 3
52
+
53
+ #define MOSI 1
54
+
55
+ #define MISO 0
56
+
57
+ #define SCK 2
58
+
59
+ ```
60
+
61
+
62
+
63
+ UNOの場合多分‪Arduino15\packages\arduino\hardware\avr\1.8.2\variants\standard\pins_arduino.h が使われていて、おおよそ該当する部分は
64
+
65
+ ```C++
66
+
67
+ #define PIN_SPI_SS (10)
68
+
69
+ #define PIN_SPI_MOSI (11)
70
+
71
+ #define PIN_SPI_MISO (12)
72
+
73
+ #define PIN_SPI_SCK (13)
74
+
75
+
76
+
77
+ static const uint8_t SS = PIN_SPI_SS;
78
+
79
+ static const uint8_t MOSI = PIN_SPI_MOSI;
80
+
81
+ static const uint8_t MISO = PIN_SPI_MISO;
82
+
83
+ static const uint8_t SCK = PIN_SPI_SCK;
84
+
85
+ ```
86
+
87
+ となっているので、UNOのライブラリではエラーにならないのでしょう。