Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Expose constants defined in calvinsys to Calvin scripts #12

Open
fswensson opened this issue Nov 13, 2015 · 2 comments
Open

Expose constants defined in calvinsys to Calvin scripts #12

fswensson opened this issue Nov 13, 2015 · 2 comments
Assignees

Comments

@fswensson
Copy link
Contributor

It would be nice to be able to use constants defined in an object in calvinsys from an Calvin script.

Example:
calvinsys/io/gpio_handler defines the constants PULLUP and PULLDOWN for enabling internal pull up/down resistors, these are then accessible from an Calvin script:

gpio : io.GPIOReader(pull=calvinsys.io.gpio_handler.PULLUP)

@persquare persquare self-assigned this Mar 28, 2016
@persquare
Copy link
Contributor

What about @io.gpio_handler.PULLUP using @ to signify an "address" to a value? Could be used as is, or in via a define PULLUP = @io.gpio_handler.PULLUP.

@fswensson
Copy link
Contributor Author

Looks good!

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

No branches or pull requests

2 participants