tinkeringtech / CircuitPython_rda5807

MIT License
4 stars 3 forks source link

Touch up code for Learn Guide #1

Closed dhalbert closed 1 year ago

dhalbert commented 1 year ago

Hi -- I was asked to review the Adafruit Learn Guide for your board. I made some small changes in the text and in the code to simplify it. I don't have the board so I couldn't test my changes. Could you review and suggest anything you don't want to change? I'll update the Learn Guide with the latest version once this is merged. Thanks.

tinkeringtech commented 1 year ago

Hi @dhalbert I'm ok with all the changes but need to keep the initial_timevariable for RDS to work correctly. I tested it on the board and RDS data does not show up without initial_time. This is used to check received RDS data. Please let me know if this makes sense. Thanks!

So we can leave the code as below for initial_time.

rds = tinkeringtech_rda5807m.RDSParser()

initial_time = time.monotonic()  # Initial time - used for RDS timing
dhalbert commented 1 year ago

@tinkeringtech The reason I took it out of rda5807m_simpletest.py is that the only reference to initial_time is that single assignment. It's not used anywhere else in that file.

In the README.rst example it is used in the while True: loop at the end. Does the simpletest while loop need to fixed?

Thanks.

tinkeringtech commented 1 year ago

Ah, you are right. My earlier comment does not make sense. For some reason I thought that the initial_time variable was indeed used. I approve of all the changes.

dhalbert commented 1 year ago

Thanks! Did you have a chance to test new code with your board? I just wanted to make sure the code in the guide still works after my changes.

tinkeringtech commented 1 year ago

Yes, just tried it and it worked. Thanks Dan for your time taking a look. Hope you get a board and play around with it! I personally have a soft spot for FM radio since I built my first crystal set as a kid :)

dhalbert commented 1 year ago

I just ordered a board!

tinkeringtech commented 1 year ago

Thanks. Will be in the mail tomorrow!