-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from Qeolvdxu/fence-branch
Added base fencing application
- Loading branch information
Showing
5 changed files
with
789 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"CurrentProjectSetting": null | ||
} |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
int val = 0; | ||
|
||
int analogPin1 = A0; | ||
int analogPin2 = A1; | ||
int mode = 0; // 0 epee, 1 foil, 2 sabre | ||
|
||
void setup() { | ||
Serial.begin(9600); | ||
pinMode(13, OUTPUT); | ||
} | ||
|
||
void loop() | ||
{ | ||
|
||
while (mode == 0) | ||
{ | ||
int val1 = analogRead(analogPin1); | ||
int val2 = analogRead(analogPin2); | ||
float volt1 = val*(5.0/1023.0); | ||
float volt2 = val*(5.0/1023.0); | ||
|
||
if (volt1 == 5.0 || volt2 == 5.0) | ||
{ | ||
if (volt1 == 5.0) | ||
{ | ||
digitalWrite(LED_BUILTIN, HIGH); | ||
} | ||
} | ||
} | ||
while (mode == 1) | ||
{ | ||
} | ||
while (mode == 2) | ||
{ | ||
} | ||
} |
Oops, something went wrong.