You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Obstacles avoidance by a HC-SR04 ultrasonic sensor mounted on a SG90 Servo which continuously scans the environment.
31
-
- To overcome the drawbacks of ultrasonic sensors, an additional IR or TOF (TimeOfFlight) sensor can be mounted to the servo.
33
+
- To overcome the drawbacks of ultrasonic sensors, an additional Sharp 430/1080/20150/100550 (GP2Y0A21YK0F) IR or VL53L1X TOF (TimeOfFlight) sensor can be mounted to the servo.
32
34
- Manual control implemented by a GUI using a Bluetooth HC-05 Module and the [BlueDisplay library](https://github.com/ArminJo/Arduino-BlueDisplay).
33
35
34
36
**Just overwrite the function doUserCollisionAvoiding() to test your own skill**.
@@ -101,10 +103,10 @@ Compile options for the used **PWMMotorControl library** like `USE_ENCODER_MOTOR
101
103
|`CAR_HAS_TOF_DISTANCE_SENSOR`| disabled | Use VL53L1X TimeOfFlight distance sensor. |
102
104
|`CAR_HAS_DISTANCE_SERVO`| disabled | Distance sensor is mounted on a pan servo (default for most China smart cars). |
103
105
|`DISTANCE_SERVO_IS_MOUNTED_HEAD_DOWN`| disabled | Distance.h | The distance servo is mounted head down to detect even small obstacles. The Servo direction is reverse then. |
104
-
|`CAR_HAS_PAN_SERVO`| disabled | Enables the pan slider for the `PanServo` at the `PIN_PAN_SERVO` pin. |
105
-
|`CAR_HAS_TILT_SERVO`| disabled | Enables the tilt slider for the `TiltServo` at the `PIN_TILT_SERVO` pin. |
106
-
|`CAR_HAS_CAMERA`| disabled | Enables the `Camera` button for the `PIN_CAMERA_SUPPLY_CONTROL` pin. |
107
-
|`CAR_HAS_LASER`| disabled | Enables the `Laser` button for the `PIN_LASER_OUT` / `LED_BUILTIN` pin. |
106
+
|`CAR_HAS_PAN_SERVO`| disabled | Enables the pan slider for the `PanServo` at the `PAN_SERVO_PIN` pin. |
107
+
|`CAR_HAS_TILT_SERVO`| disabled | Enables the tilt slider for the `TiltServo` at the `TILT_SERVO_PIN` pin. |
108
+
|`CAR_HAS_CAMERA`| disabled | Enables the `Camera` button for the `CAMERA_SUPPLY_CONTROL_PIN` pin. |
109
+
|`CAR_HAS_LASER`| disabled | Enables the `Laser` button for the `LASER_OUT_PIN` / `LED_BUILTIN` pin. |
108
110
|`ENABLE_RTTTL_FOR_CAR`| undefined | Plays melody after initial timeout has reached. Enables the Melody button, which plays a random melody. |
109
111
|`MONITOR_VIN_VOLTAGE`| disabled | Shows VIN voltage and monitors it for undervoltage. VIN/11 at A2, 1 MΩ to VIN, 100 kΩ to ground. |
110
112
|`ENABLE_EEPROM_STORAGE`| disabled | Activates the buttons to store compensation values. Normally they are stored after calibration. |
#defineVCC_EMERGENCY_OVERVOLTAGE_THRESHOLD_MILLIVOLT 5500 // +10 %. Max recommended operation voltage
140
+
#endif
141
+
#if !defined(VCC_CHECK_PERIOD_MILLIS)
142
+
#defineVCC_CHECK_PERIOD_MILLIS 10000L // 10 seconds period of VCC checks
143
+
#endif
144
+
#if !defined(VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP)
145
+
#defineVCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP 6 // Shutdown after 6 times (60 seconds) VCC below VCC_UNDERVOLTAGE_THRESHOLD_MILLIVOLT or 1 time below VCC_EMERGENCY_UNDERVOLTAGE_THRESHOLD_MILLIVOLT
#defineVOLTAGE_USB_POWERED_UPPER_THRESHOLD_MILLIVOLT 4950 // Assume USB powered below this voltage, because of the loss in USB cable. If we have > 4950, we assume to be powered by VIN.
154
+
// In contrast to e.g. powered by VIN, which results in almost perfect 5 volt supply
155
+
#endif
117
156
118
157
externlongsLastVCCCheckMillis;
119
158
externuint8_tsVCCTooLowCounter;
@@ -124,7 +163,6 @@ uint16_t waitAndReadADCChannelWithReference(uint8_t aADCChannelNumber, uint8_t a
#defineVCC_TOO_HIGH_EMERGENCY_STOP_MILLIVOLT5500// +10 %. Max recommended operation voltage
558
-
#endif
559
-
#if !defined(VCC_CHECK_PERIOD_MILLIS)
560
-
#defineVCC_CHECK_PERIOD_MILLIS10000// Period of VCC checks
561
-
#endif
562
-
#if !defined(VCC_CHECKS_TOO_LOW_BEFORE_STOP)
563
-
#defineVCC_CHECKS_TOO_LOW_BEFORE_STOP6// Shutdown after 6 times (60 seconds) VCC below VCC_STOP_THRESHOLD_MILLIVOLT or 1 time below VCC_EMERGENCY_STOP_MILLIVOLT
0 commit comments