diff --git a/docs/_assets/images/buck_converter.png b/docs/_assets/images/buck_converter.png new file mode 100644 index 00000000..9d31c7f8 Binary files /dev/null and b/docs/_assets/images/buck_converter.png differ diff --git a/docs/_sections/_guide-general/schedule.md b/docs/_sections/_guide-general/schedule.md index 3fcf423b..b3bdfe0e 100644 --- a/docs/_sections/_guide-general/schedule.md +++ b/docs/_sections/_guide-general/schedule.md @@ -12,4 +12,6 @@ This calendar will have the most up to date version of the competition timeline! {: .highlight} Tip: You can add this calendar to your personal Google calendar by clicking the plus button above^^ -{: .callout-toby} \ No newline at end of file +{: .callout-toby} + +Here is the (RAS office hours schedule.)[https://docs.google.com/spreadsheets/d/1MNuk1WAB5ZmVcOo-_wdnVN3yREhI9oH90169OuW2QAc/edit?gid=1317822740#gid=1317822740] You may go to any of the office hours that you please, but note that office hours are subject to change throughout the semester. \ No newline at end of file diff --git a/docs/_sections/_guide-primaries/getting-started/environment-setup.md b/docs/_sections/_guide-primaries/getting-started/environment-setup.md index 69055d66..b261b1a8 100644 --- a/docs/_sections/_guide-primaries/getting-started/environment-setup.md +++ b/docs/_sections/_guide-primaries/getting-started/environment-setup.md @@ -18,6 +18,9 @@ Note: While it is good coding practice to leave comments in your code to make it {: .callout-toby} ```cpp +#include "sdkconfig.h" +#include + int LED_BUILTIN = 2; // defines the word "LED_BUILTIN" as the number 2 for ease of use when defining and using the pin later void setup() { diff --git a/docs/_sections/_guide-primaries/getting-started/microcontroller-interface.md b/docs/_sections/_guide-primaries/getting-started/microcontroller-interface.md index 544e3aee..5b7bbe0b 100644 --- a/docs/_sections/_guide-primaries/getting-started/microcontroller-interface.md +++ b/docs/_sections/_guide-primaries/getting-started/microcontroller-interface.md @@ -11,9 +11,9 @@ Microcontrollers are cool and all, but they’re a lot more interesting when you wroom_pinout.jpg -We are only concerned with pins that are power, ground, GPIO, and ADC enabled, so don't worry about all the extra abilities. +We are only concerned with pins that are power, ground, GPIO, and ADC enabled, so don't worry about all the extra features. -* Power - 3V3 and 5V pins labeled with red. These pins will always be outputting their respective voltage levels (3.3V and 5V) as long as the ESP32 is powered. +* Power - 3V3 and 5V pins labeled with red. These pins will always be outputting their respective voltage levels (3.3V and 5V) if the ESP32 is powered through its USB-micro port. * Ground - pins labeled as GND. These pins serve as the current's return path in your circuits. * GPIO (General Purpose Input/Output) - virtually every pin. These pins can be configured to read or output digital high and low signals. * ADC (Analog to Digital Converter) - only some pins. These pins can read analog values instead of just high or low. @@ -22,6 +22,26 @@ We are only concerned with pins that are power, ground, GPIO, and ADC enabled, s Note: Do NOT short (connect) a power pin directly to a ground pin. This will likely fry your ESP32 by causing a huge surge of current. {: .callout-toby} +For this competition, you will be able to control your robot with a wireless game controller. + +It would be impractical to power your ESP32 through your laptop with a super long cable, so you will use a battery pack feeding through a buck converter to power the 5V pin of the ESP32. + +buck_converter.png + +You will use this buck converter to reduce the voltage of the battery pack down to a level the ESP32 can tolerate (5V). Here are the steps to interface the battery pack to the ESP32 (assumes ESP32 is seated in breadboard): + + 1.) Connect the red wire from the battery pack to the IN+ on the buck converter and the black wire from the battery pack to the IN- on the buck converter + + 2.) Grab a multimeter, put it into voltage reading mode, and attach the leads to OUT+ and OUT-. Rotate the small yellow screw on the buck converter counterclockwise until the multimeter reads a voltage of 5V. + + 3.) Remove the multimeter leads and attach a red wire from the buck converter's OUT+ terminal to the ESP32's 5V pin. Attach a black wire from the buck converter's OUT- terminal to the ESP32's GND pin. + + (((insert picture of wire diagram here))) + +{: .highlight} +Note: Do NOT power your ESP32 through its 5V pin using the battery pack while simultaneously connecting it to your computer!! This may seriously damage either of your devices (please only do one at a time). +{: .callout-toby} + If you want to know more about any features, feel free to ask a mentor or Google for more information :) diff --git a/docs/_sections/_guide-primaries/sensors-and-actuators/actuators.md b/docs/_sections/_guide-primaries/sensors-and-actuators/actuators.md index 78fa80ec..ec477a32 100644 --- a/docs/_sections/_guide-primaries/sensors-and-actuators/actuators.md +++ b/docs/_sections/_guide-primaries/sensors-and-actuators/actuators.md @@ -92,7 +92,7 @@ More detailed information about the L298N motor controllers can be [found here!] ## What Are Servos? -Servos are motors that are designed for precise position control. Instead of rotating arbitrarily when powered, servos listen to a control signal (usually [PWM](https://learn.sparkfun.com/tutorials/pulse-width-modulation/all)) to determine where to rotate. Some servos offer limited rotation, while others can rotate continuously (like ours).More advanced servos have other ways to be even more precise such as a feedback system on top of the control signal, but that is not necessary for this competition. +Servos are motors that are designed for precise position control. Instead of freely rotating when powered, servos listen to a control signal (usually [PWM](https://learn.sparkfun.com/tutorials/pulse-width-modulation/all)) to determine where to rotate. Some servos offer limited rotation, while others can rotate continuously (like ours).More advanced servos have other ways to be even more precise such as a feedback system on top of the control signal, but that is not necessary for this competition. ## How to Use Servos? @@ -105,7 +105,7 @@ For the servos in our competition, you can use it to precisely control your mech | White | Any PWM capable pin | {: .highlight} -If you're not sure which ESP32 pins are PWM capable, then check out the diagram in [this page!](https://ut-ras.github.io/RobotathonESP32/getting-started/microcontroller-interface) +If you're not sure which ESP32 pins are hardware PWM capable, then check out the diagram in [this page!](https://ut-ras.github.io/RobotathonESP32/getting-started/microcontroller-interface) {: .callout-toby} In this competition, we will be using the Arduino servo library to control the servos. The following is an example of how to configure the servo: 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 8d4adc07..f6bb0111 100644 --- a/docs/_sections/_guide-primaries/sensors-and-actuators/color-sensors.md +++ b/docs/_sections/_guide-primaries/sensors-and-actuators/color-sensors.md @@ -23,6 +23,10 @@ If you want more details on how the color sensor works, check out [this link!](h | SDA | GPIO21 | | SCL | GPIO22 | +{: .highlight} +Make sure to connect the color sensor's power pin to 3.3V! A 5V connection will fry the sensor. +{: .callout-toby} + ## Programming 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! 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 41a14c5d..70f4d82c 100644 --- a/docs/_sections/_guide-primaries/sensors-and-actuators/ir-sensors.md +++ b/docs/_sections/_guide-primaries/sensors-and-actuators/ir-sensors.md @@ -36,13 +36,10 @@ If you're not sure which ESP32 pins are ADC (Analog to Digital Converter) capabl {: .callout-toby} ## Programming -The following program will allow you to read values from the IR sensor in a loop. After you build and flash the program, you should see the values in your terminal output change as you move it towards and away from an object. +The following program will allow you to read values from the IR sensor in a loop. After you build and flash the program, you should see the values in your terminal change as you move it towards and away from an object. ```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 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 7190ac10..bdbd7098 100644 --- a/docs/_sections/_guide-primaries/sensors-and-actuators/line-sensors.md +++ b/docs/_sections/_guide-primaries/sensors-and-actuators/line-sensors.md @@ -6,7 +6,7 @@ parent: Sensors and Actuators nav_order: 1 --- -# Line Sensor (UNEDTIED) +# Line Sensor A necessary component for any challenge that requires your robot to follow a line. This one is the QTR-8A Reflectance Sensor Array and uses IR transmitters and receivers on it to detect lines. ## How it Works @@ -18,6 +18,11 @@ The line sensor is made up of an array of 8 IR LED/phototransistor pairs, each t Note: you do NOT have to use all of the LED/phototransistor pairs — You can leave the ones you do not want to use disconnected from the ESP32. {: .callout-toby} + +line_sensor_wiring.png + +((something something wiring)) + ## Programming The following program will allow you to continuously read a general position value of the sensor across a line. After you build and flash the program, you should see the values in the UART change as you shift the line across the different sensors. @@ -25,9 +30,6 @@ different sensors. ```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 @@ -50,10 +52,7 @@ void setup() { } void loop() { - // 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); + qtr.readLineBlack(sensors); // Get calibrated sensor values returned in the sensors array Serial.print(sensors[0]); Serial.print(" "); Serial.print(sensors[1]); @@ -75,4 +74,3 @@ TIP: always run the calibrate function (i.e. hold a line of the color you’re s * Can you automate the calibration process? -line_sensor_wiring.png diff --git a/docs/_sections/_guide-primaries/sensors-and-actuators/sensor-integration.md b/docs/_sections/_guide-primaries/sensors-and-actuators/sensor-integration.md index de15a12f..6bc78dd2 100644 --- a/docs/_sections/_guide-primaries/sensors-and-actuators/sensor-integration.md +++ b/docs/_sections/_guide-primaries/sensors-and-actuators/sensor-integration.md @@ -31,7 +31,7 @@ Building and acting upon your model of the world can be hard. To help, we’ve p We leave the implementation of the example as an exercise for the reader. Finally, we would also like to emphasize writing clean and readable code. Clean code helps both your team and the mentors by making it easier to debug. -A convention guide can be found at http://www.cs.umd.edu/~nelson/classes/resources/cstyleguide/. +A coding convention guide can be found (here!)[http://www.cs.umd.edu/~nelson/classes/resources/cstyleguide/] # Extensions * How will your robot cope with multiple challenges? diff --git a/docs/_sections/_guide-supplementals/software.md b/docs/_sections/_guide-supplementals/software.md index 8e6ca7a5..b9251c29 100644 --- a/docs/_sections/_guide-supplementals/software.md +++ b/docs/_sections/_guide-supplementals/software.md @@ -1,9 +1,13 @@ - +--- - + +variables +if statements +for loops +while loops