@@ -8,29 +8,29 @@ import (
8
8
// This example assumes that you are using the pca10040 board
9
9
10
10
func main () {
11
- led1 := machine.GPIO { machine . LED1 }
12
- led1 .Configure (machine.GPIOConfig {Mode : machine .GPIO_OUTPUT })
11
+ led1 := machine .LED1
12
+ led1 .Configure (machine.PinConfig {Mode : machine .PinOutput })
13
13
14
- led2 := machine.GPIO { machine . LED2 }
15
- led2 .Configure (machine.GPIOConfig {Mode : machine .GPIO_OUTPUT })
14
+ led2 := machine .LED2
15
+ led2 .Configure (machine.PinConfig {Mode : machine .PinOutput })
16
16
17
- led3 := machine.GPIO { machine . LED3 }
18
- led3 .Configure (machine.GPIOConfig {Mode : machine .GPIO_OUTPUT })
17
+ led3 := machine .LED3
18
+ led3 .Configure (machine.PinConfig {Mode : machine .PinOutput })
19
19
20
- led4 := machine.GPIO { machine . LED4 }
21
- led4 .Configure (machine.GPIOConfig {Mode : machine .GPIO_OUTPUT })
20
+ led4 := machine .LED4
21
+ led4 .Configure (machine.PinConfig {Mode : machine .PinOutput })
22
22
23
- button1 := machine.GPIO { machine . BUTTON1 }
24
- button1 .Configure (machine.GPIOConfig {Mode : machine .GPIO_INPUT_PULLUP })
23
+ button1 := machine .BUTTON1
24
+ button1 .Configure (machine.PinConfig {Mode : machine .PinInputPullup })
25
25
26
- button2 := machine.GPIO { machine . BUTTON2 }
27
- button2 .Configure (machine.GPIOConfig {Mode : machine .GPIO_INPUT_PULLUP })
26
+ button2 := machine .BUTTON2
27
+ button2 .Configure (machine.PinConfig {Mode : machine .PinInputPullup })
28
28
29
- button3 := machine.GPIO { machine . BUTTON3 }
30
- button3 .Configure (machine.GPIOConfig {Mode : machine .GPIO_INPUT_PULLUP })
29
+ button3 := machine .BUTTON3
30
+ button3 .Configure (machine.PinConfig {Mode : machine .PinInputPullup })
31
31
32
- button4 := machine.GPIO { machine . BUTTON4 }
33
- button4 .Configure (machine.GPIOConfig {Mode : machine .GPIO_INPUT_PULLUP })
32
+ button4 := machine .BUTTON4
33
+ button4 .Configure (machine.PinConfig {Mode : machine .PinInputPullup })
34
34
35
35
for {
36
36
led1 .Set (button1 .Get ())
0 commit comments