Skip to content

Commit c895bd5

Browse files
committed
idk alot
1 parent 5358abd commit c895bd5

File tree

5 files changed

+16
-30
lines changed

5 files changed

+16
-30
lines changed
-57.9 KB
Loading

docs/_sections/_guide-primaries/sensors-and-actuators/color-sensors.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ The APDS-9960 Color Sensor will allow you to complete the Color Challenge.
2525

2626

2727
## How it Works
28-
The RGB (Red Green Blue) sensor has an infrared LED light that detects color by emitting light and detecting with four photodiodes the reflected light. The photodiodoes are each filtered to sense the Red, Green, Blue, and Clear color components. The RGB provides the R G and B data in integer values of 0-255 (8 bit representation). We will grab that data using a communication protocol called I2C (Inter-integrated circuit), which is used in many electrical devices. Implementing I2C is out of the scope of this competition, but you can find more information about it [here.](https://learn.sparkfun.com/tutorials/i2c/all)
28+
The RGB (Red Green Blue) sensor has an infrared LED light that detects color by emitting light and detecting with four photodiodes the reflected light. The photodiodoes are each filtered to sense the Red, Green, Blue, and Clear color components. The RGB provides the R G and B strength in integer values of 0-255 (8 bit representation). We will grab that data using a communication protocol called I2C (inter-integrated circuit), which is used in many electrical devices. Implementing I2C on our own is out of the scope of this competition, but you can find more information about it [here.](https://learn.sparkfun.com/tutorials/i2c/all)
2929

30-
For the competition, you will want to make sure you understand the RGB sensor also detect ambient light levels and proximity, so make sure your color sense is placed appropriately to successfully complete the color challenge.
30+
You will definitely want to keep in mind that the sensor is affected by ambient light levels and proximity, so make sure your color sensor is placed appropriately and has sufficient (external🤔?) lighting to successfully complete the color challenge.
3131

3232
If you want more details on how the color sensor works, check out [this link!](https://www.utmel.com/components/everything-you-know-about-tcs34725-color-sensors-faq?id=1986)
3333

@@ -46,16 +46,12 @@ If you're not sure about the ESP32 pinout, then check out [this page!](https://u
4646

4747
{: .highlight}
4848
Make sure to connect the color sensor's power pin to 3.3V! A 5V connection will fry the sensor.
49-
{: .callout-blue}
49+
{: .callout-red}
5050

5151
The SDA and SCL on the color sensor MUST be connected to the specified GPIO pins on the ESP32. This is because they are the dedicated pins for I2C commmunication.
5252

53-
If you're not sure about the ESP32 pinout, then check out the diagram in [this page!](https://ut-ras.github.io/RobotathonESP32/getting-started/microcontroller-interface)
54-
55-
56-
5753
## Programming
58-
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!
54+
For this tutorial, we’re only going to be reading the color sensor values. Make sure that your pins are correctly connected or otherwise you won’t receive any data!
5955

6056
```cpp
6157

@@ -86,19 +82,9 @@ void setup() {
8682

8783
void loop() {
8884
int r, g, b, a;
89-
// Wait until color is read from the sensor
90-
while (!apds.colorAvailable()) { delay(5); }
85+
while (!apds.colorAvailable()) { delay(5); } // Wait until color is read from the sensor
9186
apds.readColor(r, g, b, a);
92-
// Read color from sensor apds.readColor(r, g, b, a);
93-
// Print color in decimal
94-
Serial.print("RED: ");
95-
Serial.print(r);
96-
Serial.print(" GREEN: ");
97-
Serial.print(g);
98-
Serial.print(" BLUE: ");
99-
Serial.print(b);
100-
Serial.print(" AMBIENT: ");
101-
Serial.println(a);
87+
Console.printf("RED: %d GREEN: %d BLUE: %d AMBIENT: %d\n", r, g, b, a);
10288
delay(100);
10389
}
10490
```

docs/_sections/_guide-primaries/sensors-and-actuators/ir-sensors.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ void setup() {
5454
}
5555

5656
void loop() {
57-
Serial.println(IRSensorName.getDistanceFloat());
57+
Console.println(IRSensorName.getDistanceFloat());
5858
delay(100);
5959
}
6060
```
6161
6262
## Extensions
63-
You received values from the sensor, but do they mean anything? The next step for the IR sensor is translating and thresholding it. Take a look at the above graph. There is a strong linear relationship between your signal value and the distance away from the object. It’s your job now to code a function that returns an accurate distance given a voltage input value. After that, your team needs to threshold the data. When do the values become inconsistent (too close or too far)? What do you do with your robot when that happens?
63+
You received values from the sensor, but what do they mean? The next step for the IR sensor is translating and thresholding it. Take a look at the above graph. There is a strong linear relationship between your signal value and the distance away from the object. It’s your job now to code a function that returns an accurate distance given a voltage input value. After that, your team needs to threshold the data. When do the values become inconsistent (too close or too far)? What do you do with your robot when that happens?
6464
65+
TODO review this extension thing and see if we want to make them actually calculate distance
6566

docs/_sections/_guide-primaries/sensors-and-actuators/line-sensors.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You do NOT have to use all 8 of the LED/phototransistor pairs — You can leave
2525
|:-------------|:------------------|
2626
| 5V | 5V |
2727
| GND | GND |
28-
| Signal | Any ADC Capable Pin (i.e. GPIO32) |
28+
| Signal | Any ADC Capable Pin (i.e. GPIO32, GPIO33) |
2929

3030
If you're not sure about the ESP32 pinout, then check out [this page!](https://ut-ras.github.io/RobotathonESP32/getting-started/microcontroller-interface)
3131

@@ -52,21 +52,19 @@ void setup() {
5252
// set up Serial Communication and sensor pins
5353
Serial.begin(115200);
5454
qtr.setTypeAnalog(); // or setTypeAnalog()
55-
qtr.setSensorPins((const uint8_t[]) {33, 32}, 2); // pin numbers go in the curly brackets {}, and number of pins goes after
55+
qtr.setSensorPins((const uint8_t[]) {32, 33}, 2); // pin numbers go in the curly brackets {}, and number of sensors in use goes after
5656

5757
// calibration sequence
5858
for (uint8_t i = 0; i < 250; i++) {
59-
Serial.println("calibrating");
59+
Console.printf("calibrating %d/250\n", i); // 250 is the number of calibrations recommended by manufacturer
6060
qtr.calibrate();
6161
delay(20);
6262
}
6363
}
6464

6565
void loop() {
66-
qtr.readLineBlack(sensors); // Get calibrated sensor values returned in the sensors array
67-
Serial.print(sensors[0]);
68-
Serial.print(" ");
69-
Serial.println(sensors[1]);
66+
qtr.readLineBlack(sensors); // Get calibrated sensor values returned into sensors[]
67+
Console.printf("S1: %d S2: %d\n", sensors[0], sensors[1]);
7068
delay(250);
7169
}
7270

@@ -80,6 +78,6 @@ TIP: Always calibrate your line sensor to ensure consistent and accurate results
8078
* What do you do with your robot when you detect a change?
8179
* Consistency in data collection is key for calibration
8280
* Can you automate the calibration process?
83-
* Can you use the super secret NVS functions to save and restore calibration data?
81+
* Can you use the super secret NVS functions to save and restore calibration?
8482

8583

docs/_sections/_guide-primaries/sensors-and-actuators/sensor-integration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ parent: Hardware
66
nav_order: 6
77
---
88

9+
TODO: AXE
910
# Sensor Integration
1011

1112
Help! How do we put everything together?

0 commit comments

Comments
 (0)