Skip to content

Conversation

@tolauwae
Copy link
Member

Add the analog_write primitive.

@tolauwae tolauwae requested a review from carllocos June 21, 2023 10:53
@tolauwae tolauwae force-pushed the main branch 2 times, most recently from 29000c0 to adee735 Compare July 4, 2023 11:40
Copy link
Contributor

@carllocos carllocos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity is the analogWrite a newly supported function for the ESP32?

The reason why I ask is because I recall that such a function was not supported for the ESP32 which is also the reason why I wrote the previous primitive chip_analog_write (now renamed to chip_ledc_set_duty). Now seeing you use the Arduino analogWrite makes me doubt whether I overlooked its existence.

@tolauwae
Copy link
Member Author

tolauwae commented Jul 4, 2023

Out of curiosity is the analogWrite a newly supported function for the ESP32?

I thought so. I'll double check.

If not, that does pose a conundrum. Do all the Arduino primitives need to be supported for the ESP? Ideally, I'd say yes, but the counter argument is that real Arduino devices may want to use this primitives.

That is an annoying decision we will continue to encounter as long as we haven't added a modular system.
Don't know on what criteria to decided in those cases.

@carllocos
Copy link
Contributor

@tolauwae I think the analogWrite is indeed new because the reason why I wrote the now-called chip_ledc_set_duty is also because back in the time I could not compile the VM when using analogWrite on the ESP32.

That is an annoying decision we will continue to encounter as long as we haven't added a modular system.
Don't know on what criteria to decided in those cases.

Agree so maybe for the time being we should ignore this issue since this will naturally resolve when switching to a modular system.

@tolauwae
Copy link
Member Author

tolauwae commented Jul 4, 2023

But compilation works this time around. All CI checks are green.

I'll double check if it works for the fade example tomorrow.

@tolauwae
Copy link
Member Author

tolauwae commented Jul 5, 2023

@carllocos the primitive works fine on ESP32. I actually used it in code for the MobiSys demo.

@tolauwae tolauwae requested a review from carllocos July 5, 2023 08:42
@carllocos carllocos merged commit 2e43a06 into main Jul 5, 2023
@carllocos carllocos deleted the analog branch July 5, 2023 09:50
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.

3 participants