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

How to read sensors? #1

Open
eduncan911 opened this issue Dec 26, 2016 · 1 comment
Open

How to read sensors? #1

eduncan911 opened this issue Dec 26, 2016 · 1 comment

Comments

@eduncan911
Copy link

How would one read sensors and act upon them?

What about measuring steps of the encoders on the GoPiGo board?

Bonus points for how to use other bits of the raspberry pi GPIO pins along side the GoPiGo board.

@eduncan911
Copy link
Author

Ok, looking at the source it looks like you created the constants:

// Command values supported by GoPiGo.
const (
  usCmd             = 117 // Read the distance from the ultrasonic sensor
)

// Left turns GoPiGo left slowly.
func (p *GoPiGo) Left() error {
  p.mu.Lock()
  defer p.mu.Unlock()
  return p.sendCmd(cmdValues(leftCmd))
}

But...

  1. you kept the conts private, not able to be re-used.
  2. you kept the sendCmd() private as well, not able to be re-used.

Do you plan on extending the library to read the ultrasonic sensor and other sensors, such a the line sensor?

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

1 participant