chip: correct ]base for new 4.4 GPIO

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2016-12-02 00:01:05 +01:00
parent 7af92e875d
commit 4d628eebbc
3 changed files with 15 additions and 15 deletions

View File

@ -10,7 +10,7 @@ import (
func main() {
chipAdaptor := chip.NewAdaptor()
led := gpio.NewLedDriver(chipAdaptor, "XIO-P0")
led := gpio.NewLedDriver(chipAdaptor, "XIO-P6")
work := func() {
gobot.Every(1*time.Second, func() {

View File

@ -29,14 +29,14 @@ var pinsOriginal = map[string]int{
}
var pins44 = map[string]int{
"XIO-P0": 1016,
"XIO-P1": 1017,
"XIO-P2": 1018,
"XIO-P3": 1019,
"XIO-P4": 1020,
"XIO-P5": 1021,
"XIO-P6": 1022,
"XIO-P7": 1023,
"XIO-P0": 1013,
"XIO-P1": 1014,
"XIO-P2": 1015,
"XIO-P3": 1016,
"XIO-P4": 1017,
"XIO-P5": 1018,
"XIO-P6": 1019,
"XIO-P7": 1020,
}
// NewAdaptor creates a C.H.I.P. Adaptor

View File

@ -55,18 +55,18 @@ func TestChipAdaptorDigitalIO(t *testing.T) {
fs := sysfs.NewMockFilesystem([]string{
"/sys/class/gpio/export",
"/sys/class/gpio/unexport",
"/sys/class/gpio/gpio1016/value",
"/sys/class/gpio/gpio1016/direction",
"/sys/class/gpio/gpio1023/value",
"/sys/class/gpio/gpio1023/direction",
"/sys/class/gpio/gpio1013/value",
"/sys/class/gpio/gpio1013/direction",
"/sys/class/gpio/gpio1020/value",
"/sys/class/gpio/gpio1020/direction",
})
sysfs.SetFilesystem(fs)
a.DigitalWrite("XIO-P0", 1)
gobottest.Assert(t, fs.Files["/sys/class/gpio/gpio1016/value"].Contents, "1")
gobottest.Assert(t, fs.Files["/sys/class/gpio/gpio1013/value"].Contents, "1")
fs.Files["/sys/class/gpio/gpio1023/value"].Contents = "1"
fs.Files["/sys/class/gpio/gpio1020/value"].Contents = "1"
i, _ := a.DigitalRead("XIO-P7")
gobottest.Assert(t, i, 1)