Hi,
I´m trying to generate an AC signal with my ESP-32 and I´m having some inconviniences. I´m going to be sending squared pulses from 0V to 3.3V, the period is going to depend on what I need at the moment, but generally it´ll be something like 10ms ON - 100ms OFF. Can anyone give me some advice on how to achieve this?
Thanks!
AC converter to DC
-
MicroController
- Posts: 2705
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: AC converter to DC
Use a timer. Set it to e.g. 100ms. When it expires, turn output on, reset timer to 10ms; next time it expires, turn output off, reset timer to 100ms.
Re: AC converter to DC
Due to scheduling and interruptions the timings may be off quite a bit. I'd suggest to abuse one of the available hardware modules for this, e.g. UART, SPI or I2S. Or RMT if available.
Who is online
Users browsing this forum: Applebot, Baidu [Spider], Google [Bot] and 3 guests