tehviking / brick_pi_ruby

ruby wrappers for the BrickPi Lego Mindstorms C library
MIT License
7 stars 3 forks source link

Sensor instructions #3

Closed Floppy closed 10 years ago

Floppy commented 10 years ago

Added instructions and samples on how to read sensors, and added a couple of convenience methods to Sensor like touched? and distance.

tehviking commented 10 years ago

This is cool. There's also a mapping on the Color sensor of 1-6 of colors according to this array: [null, "Black","Blue","Green","Yellow","Red","White"] (so that it's 1-ordinal I guess?)

I'll put a ticket for that in the backlog. Nice work!

Floppy commented 10 years ago

I didn't fiddle around with the colour sensor, so didn't add it here, but yes, would be good to have the same sort of query methods for colours.