kidoman / embd

Embedded Programming Framework in Go
http://embd.kidoman.io
MIT License
1.28k stars 156 forks source link

added support for the Intel Edison #73

Open cfreeman opened 7 years ago

cfreeman commented 7 years ago

Pin outs for the Edison are based on this 'block' from sparkfun -- https://www.sparkfun.com/products/13038

cfreeman commented 7 years ago

The only driver that has been tested so far is i2c ( during the development of #72 ), GPIO, LED and SPI have not been tested yet.

cfreeman commented 7 years ago

Ran some more tests today. GPIO works in both directions and the pin mappings all work out and line up with the 'block' from Sparkfun.

    embd.InitGPIO()
    defer embd.CloseGPIO()

    p, _ := embd.NewDigitalPin(46)
    p.SetDirection(embd.In)

    for i := 0; i < 50; i++ {
        o, _ := p.Read()
        fmt.Printf("PIN: %d\n", o)
        time.Sleep(1 * time.Second)
    }

Reading from a switch/button requires 1k pullup resistor.