Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up analog input class #45

Open
EmilyRobotics opened this issue Nov 29, 2020 · 2 comments
Open

Clean up analog input class #45

EmilyRobotics opened this issue Nov 29, 2020 · 2 comments
Assignees

Comments

@EmilyRobotics
Copy link
Contributor

Needs to be rewritten to be cleaner and better coded, also needs more comments

@mcolinj
Copy link
Contributor

mcolinj commented Dec 10, 2020

The analog input is interesting because it is designed to support two different ADC chips. You can see in the init that it sends a code on the i2c bus to discover which chip is on the bus. I think they may have changed chips from an earlier version of the board and they want the software to support either. At any rate, they store the chip identity in a string and then switch on it so they can use a different function later. I think you know how to do that better. Also, the code could use some comments describing what it is doing. Also, we could figure out which chip is on the version 2.2 board that we are using and decide to eliminate the unneeded code. (it could be put into a different AnalogInput implementation that could, perhaps be used by someone who had the older board.

@mcolinj
Copy link
Contributor

mcolinj commented Dec 10, 2020

Once we know which chip they are using, we could focusing on making that code better. They use a different approach to getting a value. See if you can figure out how they differ. It may be a challenge, but I think you are up to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants