Skip to content

Commit

Permalink
Renaming exercises and modifed README (#2)
Browse files Browse the repository at this point in the history
* 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
sho6715 and Tiryoh authored Jul 13, 2020
1 parent 635d30d commit 1f9c2b3
Show file tree
Hide file tree
Showing 20 changed files with 1,332 additions and 1,332 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Arduino_Exercises/practice1.ino
* Arduino_Exercises/Exercise1/Exercise1.ino
*
* Copyright(C) 2020 RT Corporation <support@rt-net.jp>
* All rights reserved.
Expand Down
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);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Arduino_Exercises/practice11.ino
* Arduino_Exercises/Exercise11/Exercise11.ino
*
* Copyright(C) 2020 RT Corporation <support@rt-net.jp>
* All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Arduino_Exercises/practice12.ino
* Arduino_Exercises/Exercise12/Exercise12.ino
*
* Copyright(C) 2020 RT Corporation <support@rt-net.jp>
* All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Arduino_Exercises/practice13.ino
* Arduino_Exercises/Exercise13/Exercise13.ino
*
* Copyright(C) 2020 RT Corporation <support@rt-net.jp>
* All rights reserved.
Expand Down
Loading

0 comments on commit 1f9c2b3

Please sign in to comment.