Skip to content

Commit

Permalink
Fix beaglebone black issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Jun 6, 2014
1 parent fc124dd commit bd3599d
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 11 deletions.
Empty file modified device.go
100755 → 100644
Empty file.
Empty file modified driver.go
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions examples/beaglebone_led_brightness_with_analog_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ func main() {
led := gpio.NewLedDriver(beagleboneAdaptor, "led", "P9_14")

work := func() {
gobot.Every(0.1*time.Second, func() {
gobot.Every(100*time.Millisecond, func() {
val := sensor.Read()
brightness := uint8(gpio.ToPwm(val))
brightness := uint8(gobot.ToScale(gobot.FromScale(float64(val), 0, 1024), 0, 255))
fmt.Println("sensor", val)
fmt.Println("brightness", brightness)
led.Brightness(brightness)
Expand Down
Empty file modified examples/firmata_makey_button.go
100755 → 100644
Empty file.
Empty file modified examples/sphero_api.go
100755 → 100644
Empty file.
Empty file modified examples/sphero_master.go
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion platforms/beaglebone/beaglebone_adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (b *BeagleboneAdaptor) I2cWrite(data []byte) {
b.i2cDevice.write(data)
}

func (b *BeagleboneAdaptor) I2cRead(size byte) []byte {
func (b *BeagleboneAdaptor) I2cRead(size uint) []byte {
return b.i2cDevice.read(size)
}

Expand Down
2 changes: 1 addition & 1 deletion platforms/beaglebone/i2c_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (me *i2cDevice) write(data []byte) {
me.i2cDevice.Write(data)
}

func (me *i2cDevice) read(len byte) []byte {
func (me *i2cDevice) read(len uint) []byte {
buf := make([]byte, len)
me.i2cDevice.Read(buf)
return buf
Expand Down
2 changes: 1 addition & 1 deletion platforms/gpio/analog_sensor_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type AnalogSensorDriver struct {
Adaptor AnalogReader
}

func NewAnalogSensor(a AnalogReader, name string, pin string) *AnalogSensorDriver {
func NewAnalogSensorDriver(a AnalogReader, name string, pin string) *AnalogSensorDriver {
return &AnalogSensorDriver{
Driver: gobot.Driver{
Name: name,
Expand Down
2 changes: 1 addition & 1 deletion platforms/gpio/analog_sensor_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var _ = Describe("Analog-Sensor", func() {
)

BeforeEach(func() {
a = NewAnalogSensor(t, "bot", "1")
a = NewAnalogSensorDriver(t, "bot", "1")
})

It("Must be able to Read", func() {
Expand Down
Empty file modified platforms/gpio/makey_button_driver.go
100755 → 100644
Empty file.
5 changes: 0 additions & 5 deletions platforms/gpio/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,3 @@ type DigitalWriter interface {
type DigitalReader interface {
DigitalRead(string) int
}

// convert to PWM value from analog reading
func ToPwm(i int) byte {
return byte((255 / 1023.0) * float64(i))
}
Empty file modified test_helper.go
100755 → 100644
Empty file.

0 comments on commit bd3599d

Please sign in to comment.