投稿

ラベル(Arduino)が付いた投稿を表示しています

Sparkfun Pro Micro 備忘録

2023.12.04追記 Arduino IDE 2.2.1使用。 ①32U4のドライバーをインストールする。 Arduino_Boards-masterのsigned_driver ② 追加のボードマネージャの URL https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json ③ボードマネージャで「 SparkFun AVR Boards」  を探してインストール ~~~~~~~~~~~~~~~~~~~~~ i2cのピンが異なる。  For i2C connections to Sparkfun Pro Micro or Arduino Micro, physical wiring is as follows: SDA connects to Arduino Micro pin Labeled 2 (not A2) SCL connects to Arduino Micro, pin Labeled 3 (not A3) GND connects to GND POWER: i2C devices usually require power. Pins may be labeled VCC, 5V or 3V. (*** BE CAREFUL HERE ***) This may be connected to Arduino Micro under the following conditions. 1) The i2C device consumes less current (ma) ,at all times, than your Arduino can provide. 2a) The i2C device consumes the same voltage that your Arduino provides. 2b) The i2C device consumes the less voltage that your Arduino provides, but has an added regulator that lowers the voltage to the co...

Happy Hacking Keyboard (PS2 to HID) インターフェース作成

イメージ
手元にあるUNOでPS2キーボードからシリアル出力まではPS2Keyboard, PS2KyboardAdvanced ライブラリーで動作を確認。 さて、HIDのパートになるとUNOに載っているUSBチップに併せて、FLIPでHEXを書き込む?? なるほど、それでいろんなサイトでみるのは Leonard(ATmega32u4) 使ってるわけだ。UNOはプロトタイプ用で最終的な組み立ては小型なものだから Pro Micro ATMEGA32U4 5V/16MHZ  を注文しました。これが届いたら続きを。。。 PS2のアダプター作成 ① 緑 Clock ② 白 Data ③ 青 GND ④ 黒 5v ⑤ 無 ケースシールド PS2 to Serial  PS2Keyboard Library https://github.com/PaulStoffregen/PS2Keyboard #include <PS2Keyboard.h> const int DataPin = 2; const int IRQpin =  3; PS2Keyboard keyboard; void setup() {   keyboard.begin(DataPin, IRQpin);   Serial.begin(9600); } void loop() {   if (keyboard.available()) {     char c = keyboard.read();     Serial.print(c);   } } https://gist.github.com/DorianRudolph/ca283dfdfd185bc812b7 Arduino 1.8.13 C:\Arduino\libraries\Keyboard\src\Keyboard.h private -> public   void sendReport(KeyReport* keys); 割り込み番号 デジタルピンに対応した割り込みの番号を指定。 Board int.0 int.1 int.2 int.3 int.4 int.5 Uno, Ethernet 2 3 Mega2560 2 ...