-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the cpp file for the distance sensor and reverted main
- Loading branch information
1 parent
dda2bbf
commit f4d8f53
Showing
3 changed files
with
56 additions
and
10 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
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,39 @@ | ||
/** | ||
* \file devices/vdml_distance.cpp | ||
* | ||
* Contains functions for interacting with the V5 ADI. | ||
* | ||
* Copyright (c) 2017-2020, Purdue University ACM SIGBots. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#include "pros/distance.hpp" | ||
|
||
namespace pros { | ||
using namespace pros::c; | ||
|
||
Distance::Distance(const std::uint8_t port):_port(port){} | ||
|
||
Distance::get(){ | ||
return distance_get(_port); | ||
} | ||
|
||
Distance::get_confidence(){ | ||
return distance_get_confidence(_port); | ||
} | ||
|
||
Distance::get_object_size(){ | ||
return distance_get_object_size(_port); | ||
} | ||
|
||
Distance::get_object_velocity(){ | ||
return distance_get_object_velocity(_port); | ||
} | ||
|
||
Distance::get_port(){ | ||
return _port; | ||
} | ||
} |
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