mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
avr: pin change interrupt
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
//go:build arduino
|
||||
|
||||
package main
|
||||
|
||||
import "machine"
|
||||
|
||||
const (
|
||||
button = machine.D2
|
||||
buttonMode = machine.PinInputPullup
|
||||
buttonPinChange = machine.PinRising
|
||||
)
|
||||
@@ -5,6 +5,7 @@ package main
|
||||
import "machine"
|
||||
|
||||
const (
|
||||
button = machine.BUTTON
|
||||
buttonMode = machine.PinInputPulldown
|
||||
buttonPinChange = machine.PinFalling
|
||||
)
|
||||
|
||||
@@ -5,6 +5,7 @@ package main
|
||||
import "machine"
|
||||
|
||||
const (
|
||||
button = machine.BUTTON
|
||||
buttonMode = machine.PinInputPullup
|
||||
buttonPinChange = machine.PinRising
|
||||
)
|
||||
|
||||
@@ -12,8 +12,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
button = machine.BUTTON
|
||||
led = machine.LED
|
||||
led = machine.LED
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -5,6 +5,7 @@ package main
|
||||
import "machine"
|
||||
|
||||
const (
|
||||
button = machine.BUTTON
|
||||
buttonMode = machine.PinInputPulldown
|
||||
buttonPinChange = machine.PinRising | machine.PinFalling
|
||||
)
|
||||
|
||||
@@ -5,6 +5,7 @@ package main
|
||||
import "machine"
|
||||
|
||||
const (
|
||||
button = machine.BUTTON
|
||||
buttonMode = machine.PinInput
|
||||
buttonPinChange = machine.PinFalling
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user