Created
June 15, 2012 15:51
-
-
Save kik/2937189 to your computer and use it in GitHub Desktop.
Arduinoかんたん
This file contains hidden or 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
| int sc_rst = 2; | |
| byte read_rst() { | |
| return digitalRead(sc_rst); | |
| } | |
| void setup() { | |
| Serial.begin(9600); | |
| pinMode(sc_rst, INPUT); | |
| while (read_rst()) | |
| ; | |
| } | |
| void loop() { | |
| if (!read_rst()) { | |
| while (!read_rst()) | |
| ; | |
| Serial.println("SC Reset"); | |
| Serial1.begin(10752); | |
| UCSR1C |= B00101000; | |
| while (read_rst()) { | |
| if (Serial1.available() > 0) { | |
| byte r = Serial1.read(); | |
| Serial.print("recv: "); | |
| Serial.println(r, HEX); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment