Skip to content

-target arduino "PinInputPullup not declared by package machine". #918

@yevsia

Description

@yevsia

Traget board : Arduino UNO.
Goal : Up-Down -> "Pull-up Resistor".
Result build : PinInputPullup not declared by package machine.

Code :

package main

import (
	"machine"
	"time"
)

const (
	led    = machine.Pin(13)
	button = machine.Pin(12)
)

func main() {
	led.Configure(machine.PinConfig{Mode: machine.PinOutput})
	button.Configure(machine.PinConfig{Mode: machine.PinInputPullup})

	for {
		if !button.Get() {
			led.High()
		} else {
			led.Low()
		}

		time.Sleep(time.Millisecond * 10)
	}
}

Comment : Arduino UNO don't support Pull-up Resistors?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions