File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
Learn/Simple Libraries/Robotics/S3/libs3 Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,15 @@ the Test Utility, cycle the Scribbler//s power switch.
7474
7575*/
7676
77- int main () {
77+ // ------ Libraries and Definitions ------
78+ #include "simpletools.h"
79+ #include "s3.h"
80+
81+
82+
83+ // ------ Main Program ------
84+ int main ()
85+ {
7886
7987}
8088
Original file line number Diff line number Diff line change @@ -118,11 +118,19 @@ int32_t s3_readMic()
118118static void s3_obstacler ()
119119{
120120 int32_t side , ObstacleThld ;
121- if (scribbler_get_obstacle_threshold () != SCRIBBLER_DEFAULT_OBSTACLE_THLD ) {
122- ObstacleThld = scribbler_get_obstacle_threshold ();
121+ if (scribbler_get_model_s3 ()) {
122+ if (scribbler_get_obstacle_threshold () != S3_OBSTACLE_THLD ) {
123+ ObstacleThld = scribbler_get_obstacle_threshold ();
124+ } else {
125+ ObstacleThld = S3_OBSTACLE_THLD ;
126+ }
123127 } else {
124- ObstacleThld = S3_OBSTACLE_THLD ;
125- }
128+ if (scribbler_get_obstacle_threshold () != SCRIBBLER_DEFAULT_OBSTACLE_THLD ) {
129+ ObstacleThld = scribbler_get_obstacle_threshold ();
130+ } else {
131+ ObstacleThld = SCRIBBLER_DEFAULT_OBSTACLE_THLD ;
132+ }
133+ }
126134 while (1 ) {
127135 for (side = SCRIBBLER_OBS_TX_LEFT ; side <= SCRIBBLER_OBS_TX_RIGHT ; side = side + 9 ) {
128136 FRQA = (14000 * ObstacleThld ) + (20607 * (100 - ObstacleThld ));
You can’t perform that action at this time.
0 commit comments