Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analogWrite demo code #12

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

jywarren
Copy link
Member

Attempted addition of analogWrite interface to demo. Not tested yet.

@jywarren
Copy link
Member Author

OK - I found that we can write to analog pins by treating them as digital pins, like:

board.digitalWrite(16, 1);

Where A0 is pin 14, A1 is pin 15, etc -- so + 14.

But I haven't been able to confirm that we can write to analog pins with analog values yet... need some hardware changes to get that working, as my current board has analog pins set up as digital ones for LEDs and I can't seem to get this to work:

Demo.board.analogWrite(15, 128);
Demo.board.analogWrite(1, 128); // or without adding 14, which should be the correct way

That should be the same as pwmWrite() according to this line, but neither seems to work.

@jywarren jywarren changed the base branch from master to main June 24, 2020 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant