Skip to content

Commit

Permalink
Merge pull request #30 from Qeolvdxu/fence-branch
Browse files Browse the repository at this point in the history
Added base fencing application
  • Loading branch information
jaguar017 authored Oct 17, 2021
2 parents bf85b3e + caef423 commit 15dd5ed
Show file tree
Hide file tree
Showing 5 changed files with 789 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
36 changes: 36 additions & 0 deletions Fencing Detection/Fencing.ino
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)
{
}
}
Loading

0 comments on commit 15dd5ed

Please sign in to comment.