This repository was archived by the owner on May 11, 2025. It is now read-only.
Open
Conversation
Add write to uart and usb. Committing changes by @Asher123456789 that did try catch, and other modifications
azvanderpas
reviewed
Mar 12, 2023
| except: | ||
| sensor2Range = -1 | ||
| print("{0}, {1},".format(sensor1Range, sensor2Range)) | ||
| uart.write(bytearray("{0}, {1},\r\n".format(sensor1Range, sensor2Range))) |
There was a problem hiding this comment.
Why include the carriage return (\r)? Doesn't seem like the roboRIO code expects it
Comment on lines
+15
to
+16
| sensor1Range = -2.0 | ||
| sensor2Range = -2.0 |
There was a problem hiding this comment.
Should these just be -2 so they don't get initialized as floating point values? If something weird happens and they fall through to the UART, it'll write a long floating point to string conversion (e.g. "-2.0000000"), won't it?
Contributor
Author
There was a problem hiding this comment.
good call, will change.
| i2c1 = busio.I2C(board.GP5, board.GP4) | ||
| vl53_1 = adafruit_vl53l0x.VL53L0X(i2c1) | ||
| except: | ||
| print("No 1st sensor connected") |
There was a problem hiding this comment.
Do these prints get saved anywhere where we could access them later? After a match for instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add write to uart and usb.
Committing changes by @Asher123456789 that did try catch, and other modifications