mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
avr: use standard pin numbering
This commit changes pin numbering for atmega328 based boards (Uno, Nano) to use the standard format, where pin number is determined by the pin/port. Previously, pin numbers were based on what the Uno uses, which does not seem to have a clear pattern. One difference is that counting starts at port B, as there is no port A. So PB0 is 0, PB1 is 1… PC0 is 8. This commit also moves PWM code to the atmega328 file, as it may not be generic to all ATmega chips.
This commit is contained in:
committed by
Ron Evans
parent
2c71f08922
commit
6b8940421e
@@ -5,11 +5,9 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// This example assumes that the button is connected to pin 8. Change the value
|
||||
// below to use a different pin.
|
||||
const (
|
||||
led = machine.LED
|
||||
button = machine.Pin(8)
|
||||
button = machine.BUTTON
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user