From b741b485ed99402e6c2d363029cd1482e710c4ac Mon Sep 17 00:00:00 2001 From: tguyenn Date: Tue, 17 Sep 2024 17:32:08 -0500 Subject: [PATCH] Addded link to dues. Verified sample code actually works (except for motors) --- docs/_sections/_guide-general/forms.md | 2 +- .../sensors-and-actuators/color-sensors.md | 7 +++---- .../sensors-and-actuators/ir-sensors.md | 7 ++++--- .../sensors-and-actuators/line-sensors.md | 17 +++++++++++++---- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/_sections/_guide-general/forms.md b/docs/_sections/_guide-general/forms.md index 0f7cfa7b..eda9518d 100644 --- a/docs/_sections/_guide-general/forms.md +++ b/docs/_sections/_guide-general/forms.md @@ -11,7 +11,7 @@ This page contains direct links and forms that you might need for Robotathon! [Robotathon Linktree](https://linktr.ee/robotathon2024?utm_source=linktree_profile_share<sid=e97f46bf-044a-4460-9ae9-b069387234ea){: .btn .btn-purple }
-[Robotathon Dues Form (todo)](a){: .btn .btn-green } +[Robotathon Dues Form (https://utdirect.utexas.edu/txshop/item_details.WBX?application_name=ENENGALU&component=0&dept_prefix=EN&item_id=155&cat_seq_chosen=01&subcategory_seq_chosen=000)](a){: .btn .btn-green } [RAS Dues Form](https://utdirect.utexas.edu/nlogon/txshop/item_details.WBX?application_name=ENENGALU&component=0&dept_prefix=E2&item_id=199&cat_seq_chosen=02&subcategory_seq_chosen=000){: .btn .btn-green }
[RAS Safety Waiver](https://docs.google.com/forms/d/e/1FAIpQLSdRvNc2R3vnG0AXu4k7bypacyeB2jgF_D1nDPq76kE8WIIBmQ/viewform){: .btn .btn-green } diff --git a/docs/_sections/_guide-primaries/sensors-and-actuators/color-sensors.md b/docs/_sections/_guide-primaries/sensors-and-actuators/color-sensors.md index 0266dcce..8d4adc07 100644 --- a/docs/_sections/_guide-primaries/sensors-and-actuators/color-sensors.md +++ b/docs/_sections/_guide-primaries/sensors-and-actuators/color-sensors.md @@ -27,13 +27,10 @@ If you want more details on how the color sensor works, check out [this link!](h For this tutorial, we’re only going to be reading the RGB sensor values from the TCS34725. Make sure that your pins are correctly connected or otherwise you won’t receive the data! ```cpp + #include "sdkconfig.h" -#ifndef CONFIG_BLUEPAD32_PLATFORM_ARDUINO -#error "Must only be compiled when using Bluepad32 Arduino platform" -#endif // !CONFIG_BLUEPAD32_PLATFORM_ARDUINO #include - #include #include #include @@ -60,6 +57,7 @@ void loop() { int r, g, b, a; // Wait until color is read from the sensor while (!apds.colorAvailable()) { delay(5); } + apds.readColor(r, g, b, a); // Read color from sensor apds.readColor(r, g, b, a); // Print color in decimal Serial.print("RED: "); @@ -70,6 +68,7 @@ void loop() { Serial.print(b); Serial.print(" AMBIENT: "); Serial.println(a); + delay(100); } ``` diff --git a/docs/_sections/_guide-primaries/sensors-and-actuators/ir-sensors.md b/docs/_sections/_guide-primaries/sensors-and-actuators/ir-sensors.md index 3fea76a0..41a14c5d 100644 --- a/docs/_sections/_guide-primaries/sensors-and-actuators/ir-sensors.md +++ b/docs/_sections/_guide-primaries/sensors-and-actuators/ir-sensors.md @@ -47,15 +47,16 @@ The following program will allow you to read values from the IR sensor in a loop #include +ESP32SharpIR IRSensorName(ESP32SharpIR::GP2Y0A21YK0F, 27); + void setup() { Serial.begin(115200); - ESP32SharpIR IRSensorName(ESP32SharpIR::GP2Y0A21YKOF, 27); - IRSensorName.setFilterRate(0.1f); + IRSensorName.setFilterRate(1.0f); } void loop() { Serial.println(IRSensorName.getDistanceFloat()); - delay(500); + delay(100); } ``` diff --git a/docs/_sections/_guide-primaries/sensors-and-actuators/line-sensors.md b/docs/_sections/_guide-primaries/sensors-and-actuators/line-sensors.md index 94cbb7e5..7190ac10 100644 --- a/docs/_sections/_guide-primaries/sensors-and-actuators/line-sensors.md +++ b/docs/_sections/_guide-primaries/sensors-and-actuators/line-sensors.md @@ -23,6 +23,7 @@ The following program will allow you to continuously read a general position val different sensors. ```cpp + #include "sdkconfig.h" #ifndef CONFIG_BLUEPAD32_PLATFORM_ARDUINO #error "Must only be compiled when using Bluepad32 Arduino platform" @@ -32,12 +33,13 @@ different sensors. #include QTRSensors qtr; +uint16_t sensors[3]; void setup() { // set up Serial Communication and sensor pins Serial.begin(115200); qtr.setTypeAnalog(); // or setTypeAnalog() - qtr.setSensorPins((const uint8_t[]) {5, 17, 16}, 3); // pin numbers go in the curly brackets {}, and number of pins goes after + qtr.setSensorPins((const uint8_t[]) {36, 39, 34}, 3); // pin numbers go in the curly brackets {}, and number of pins goes after // calibration sequence for (uint8_t i = 0; i < 250; i++) { @@ -48,9 +50,16 @@ void setup() { } void loop() { - uint16_t sensors [3]; - // Get calibrated sensor values returned in the sensors array, along with the // line position, which will range from 0 to 2000, with 1000 corresponding to // a position under the middle sensor. - int16_t position = qtr.readLineBlack (sensors); + // Get calibrated sensor values returned in the sensors array, along with the + // line position, which will range from 0 to 2000, with 1000 corresponding to + // a position under the middle sensor. + qtr.readLineBlack(sensors); + Serial.print(sensors[0]); + Serial.print(" "); + Serial.print(sensors[1]); + Serial.print(" "); + Serial.println(sensors[2]); + delay(250); } ```