-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renaming exercises and modifed README (#2)
* change paractice name * modified filename * Update Arduino_Exercises/Exercise10/Exercise10.ino Co-authored-by: Daisuke Sato <daisuke.sato@rt-net.jp> * Update Exercise10.ino Co-authored-by: Daisuke Sato <daisuke.sato@rt-net.jp>
- Loading branch information
Showing
20 changed files
with
1,332 additions
and
1,332 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
Arduino_Exercises/practice1/practice1.ino → Arduino_Exercises/Exercise1/Exercise1.ino
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
104 changes: 52 additions & 52 deletions
104
Arduino_Exercises/practice10/practice10.ino → Arduino_Exercises/Exercise10/Exercise10.ino
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
/* | ||
* Arduino_Exercises/practice10.ino | ||
* | ||
* Copyright(C) 2020 RT Corporation <support@rt-net.jp> | ||
* All rights reserved. | ||
* | ||
* License: Apache License, Version 2.0 | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
*/ | ||
|
||
int LINE_L2_Pin = A5; | ||
int LINE_L1_Pin = A4; | ||
int LINE_R1_Pin = A3; | ||
int LINE_R2_Pin = A2; | ||
int LED_Pin = D13; | ||
int SW1_Pin = D7; | ||
int SW2_Pin = D8; | ||
|
||
int flag = 0; | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
pinMode(LED_Pin,OUTPUT); | ||
pinMode(SW1_Pin,INPUT_PULLUP); | ||
pinMode(SW2_Pin,INPUT_PULLUP); | ||
Serial.begin(115200); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
if(digitalRead(SW1_Pin)==LOW){ | ||
flag = 1; | ||
delay(30); | ||
while(digitalRead(SW1_Pin)==LOW); | ||
delay(30); | ||
} | ||
if(digitalRead(SW2_Pin)==LOW){ | ||
flag = 0; | ||
delay(30); | ||
while(digitalRead(SW1_Pin)==LOW); | ||
delay(30); | ||
} | ||
if (flag == 1){ | ||
Serial.printf("\n\r LL2=%d LL1=%d LR1=%d LR2=%d", | ||
analogRead(LINE_L2_Pin),analogRead(LINE_L1_Pin),analogRead(LINE_R1_Pin),analogRead(LINE_R2_Pin)); | ||
} | ||
digitalWrite(LED_Pin,HIGH); | ||
delay(100); | ||
digitalWrite(LED_Pin,LOW); | ||
delay(100); | ||
} | ||
/* | ||
* Arduino_Exercises/Exercise10/Exercise10.ino | ||
* | ||
* Copyright(C) 2020 RT Corporation <support@rt-net.jp> | ||
* All rights reserved. | ||
* | ||
* License: Apache License, Version 2.0 | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
*/ | ||
|
||
int LINE_L2_Pin = A5; | ||
int LINE_L1_Pin = A4; | ||
int LINE_R1_Pin = A3; | ||
int LINE_R2_Pin = A2; | ||
int LED_Pin = D13; | ||
int SW1_Pin = D7; | ||
int SW2_Pin = D8; | ||
|
||
int flag = 0; | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
pinMode(LED_Pin,OUTPUT); | ||
pinMode(SW1_Pin,INPUT_PULLUP); | ||
pinMode(SW2_Pin,INPUT_PULLUP); | ||
Serial.begin(115200); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
if(digitalRead(SW1_Pin)==LOW){ | ||
flag = 1; | ||
delay(30); | ||
while(digitalRead(SW1_Pin)==LOW); | ||
delay(30); | ||
} | ||
if(digitalRead(SW2_Pin)==LOW){ | ||
flag = 0; | ||
delay(30); | ||
while(digitalRead(SW1_Pin)==LOW); | ||
delay(30); | ||
} | ||
if (flag == 1){ | ||
Serial.printf("\n\r LL2=%d LL1=%d LR1=%d LR2=%d", | ||
analogRead(LINE_L2_Pin),analogRead(LINE_L1_Pin),analogRead(LINE_R1_Pin),analogRead(LINE_R2_Pin)); | ||
} | ||
digitalWrite(LED_Pin,HIGH); | ||
delay(100); | ||
digitalWrite(LED_Pin,LOW); | ||
delay(100); | ||
} |
2 changes: 1 addition & 1 deletion
2
Arduino_Exercises/practice11/practice11.ino → Arduino_Exercises/Exercise11/Exercise11.ino
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
2 changes: 1 addition & 1 deletion
2
Arduino_Exercises/practice12/practice12.ino → Arduino_Exercises/Exercise12/Exercise12.ino
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
2 changes: 1 addition & 1 deletion
2
Arduino_Exercises/practice13/practice13.ino → Arduino_Exercises/Exercise13/Exercise13.ino
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
Oops, something went wrong.