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

Device should seed random generator #9

Open
pelikhan opened this issue Jan 20, 2017 · 6 comments
Open

Device should seed random generator #9

pelikhan opened this issue Jan 20, 2017 · 6 comments
Assignees
Labels

Comments

@pelikhan
Copy link
Contributor

Random currently returns always 0.

@jamesadevine
Copy link
Collaborator

@pelikhan try https://github.com/lancaster-university/codal/tree/rng, random_value was not being set.

@jamesadevine
Copy link
Collaborator

(have no device to test it on, hence the separate branch)

@finneyj
Copy link
Collaborator

finneyj commented Jan 20, 2017

:-) just fixed it @jamesadevine

push coming up...

@jamesadevine
Copy link
Collaborator

I'll delete my patch then? 😉

@finneyj
Copy link
Collaborator

finneyj commented Jan 20, 2017

I'll let you decide which is best...

finneyj added a commit that referenced this issue Jan 20, 2017
- Update API to allow allow definition of per device RNG seed
- Update to AnalogSensor to create a valid initial sample on creation.
@finneyj
Copy link
Collaborator

finneyj commented Jan 21, 2017

Fixed on my tests...

@pelikhan There's now a static default "0xC0DA1" to protect against a seed never being set, and I've also added a line here that shows how to seed it with a non deterministic value for CircuitPlayground... You might want to do this in PXT too:

https://github.com/lancaster-university/codal-adafruit-cplay/blob/master/source/CircuitPlayground.cpp#L75

Can you please test and close if it works for you...

microbit-carlos pushed a commit to microbit-carlos/codal that referenced this issue Jan 20, 2023
…ild-py-fix-t-help

build.py: Fix option description for the `-t/test_platform` option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants