-
Notifications
You must be signed in to change notification settings - Fork 74
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
Hitechnic SuperPro Board #187
Comments
Did some experimenting with this.. Wrote this program. Got "16" back with some data! import nxt.locator
import nxt.sensor.generic
brick = nxt.locator.find()
sensor = brick.get_sensor(nxt.sensor.Port.S1, nxt.sensor.generic.BaseDigitalSensor)
# sensor.I2C_DEV = 0x10
# sensor._i2c_query(0x00, '<8B')
for x in range(0, 255):
print(x)
try:
sensor.I2C_DEV = x
print(sensor._i2c_query(0x00, '<8B'))
except Exception as e:
pass # print(e) Returns:
So then the next logical conclusion: import nxt.locator
import nxt.sensor.generic
brick = nxt.locator.find()
sensor = brick.get_sensor(nxt.sensor.Port.S1, nxt.sensor.generic.BaseDigitalSensor)
sensor.I2C_DEV = 0x10
sensor._i2c_query(0x00, '<8B') That returns the same array as above. Wohoo! So I determined after a lot of testing that there were 2 issues:
|
Thank, this is great findings! It’s strange that they changed the I2C address, this means that the autodetect can not work with this device. It looks like SuperPro and Prototype are different boards: Would you like to make a new sensor class for the SuperPro? |
Sure. I'd be happy to.
Huh. Funny you share that link with that picture because it looks identical to a board that I have that's identified by nothing other than |
I just tested the I'd say that the interface could probably be improved a little from passing the class instance (it feels kinda clunky), but it does work at a minimum. I did find some .. odd? behavior with the digital mode setting; it could be an issue with the device itself but it seems like digital reads or writes is an all or nothing thing for the whole digital bus. I'm not certain if it's the Python doing that or if it's the device firmware running on the chip on the Prototype board itself. More testing to be done there. |
See #188 |
Thanks to Jared Dunbar for the test! Also fix an obviously wrong registers definition. See #187
Nice to resurrect some old hardware :)
Could you clarify this?
I would say it is done in the board firmware, it’s a classic way to handle it. If you want to only change a port, you need a Read-Modify-Write cycle. |
Mostly, I find it odd that this project instantiates sensors by going
The reason it's frustrating is because if you do it that way, that means that you have to set the state of the pin (meaning it's always going to be a bi-state input rather than a tri-state input). I suppose that the device we're using in this case might not support that, but I wanted to test to see if you lost access to a tri-state input by setting the device to output and configuring an output signal. |
I saw that the HiTechnic NXT SuperPro API notes that the board was only written from the specification, but I actually have one of these things! It suggested to report back findings, so here you go :)
Unfortunately, it didn't work out of the box. I tried to use it, but this is what I got:
I've never used/programmed the thing because at the time I bought it years ago, I did not know how to write C yet. But, I'd be interested in making it work if it's something of interest. It's basically never been used and should be fully functional.
PS. This is a really cool project! Definitely going to make good use of it now that I know it exists.
The text was updated successfully, but these errors were encountered: