This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#define SHIFT_REGISTER_CS 5 | |
void setup() { | |
// SPI | |
SPI.begin(); | |
SPI.setBitOrder(MSBFIRST); | |
SPI.setDataMode(SPI_MODE0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BUTTON_1 10 | |
#define BUTTON_2 11 | |
#define BUTTON_3 12 | |
#define BUTTON_4 13 | |
#define DELAY_DURATION 300 | |
#define NL 0x0A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* VirtualUsbKeyboard | |
* | |
* Enumerates itself as a HID (Human Interface Device) to a host | |
* computer using a USB shield. The Arduino then appears to the host to | |
* be a USB keyboard and keypress events can be sent on demand. | |
* | |
* This example watches the state of 6 push buttons and when a button | |
* is pressed it sends a matching keypress event to the host. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <p18cxxx.h> | |
#include <delays.h> | |
#pragma config OSC=HS, WDT=OFF, LVP=OFF | |
void main(void){ | |
// ポートAを出力に設定する | |
TRISA = 0; | |
// 永久に繰り返す |