I am doing a project to graph the frequency response of an audio filter, for this I have to perform a frequency sweep (in my case from 0hz to 20khz) and I use an ad9833 module,
Im facing some problems, because of that im seeking for help...
The microcontroller that I am using is an esp32 and for the user interface I am using a program made in visual studio that takes the data from the micro and graphs it.
The program performs a sweep, and for each increase in frequency it reads the GPIO port 34 of the ESP, saves it in a JSON format vector of 200 samples and sends it through the serial port
The project has several parts, but I want to know if the code is well written to rule out the problem of programming the microcontroller, and continue with other problems.
not sure using a square wave is a good approached for determining the responses at that frequency because a square wave is actually made up of many frequency harmonics (see spectrum of square wave)
another question is why is there only a 10 ms delay between generating the signal and measuring it. 10 msec is just 10 cylcles at 1 kHz, just a single cycle at 100 Hz
and why not structure the code to make the measurement and then format those values into some JSON message
How can we know what you consider to be well written? As a professional, I think any program that works is well written. If it works and you muck about with it you will never be satisfied.
If you think something might be done differently. the start over with a totally fresh program and get it to work the new way.
I'm not a programmer, so almost all the code was written by chatgpt, so I couldn't tell you why it's only 10ms, maybe I should increase the delay time?
I'm using square waves temporarily, because sine waves are very distorted, but I'm working on it anyway.
And yes, you are right, it would be better to separate the part of the code that takes the data and another part of formatting in JSON
By well written I mean that if the code makes sense or is well structured by a professional... that is, 1- frequency sweep, 2- data collection, 3- formatting in JSON, etc...
I have problems when graphing the response that the esp32 reads in visual studio, instead of having a bode type function, I have a series of pulses that come from the ad9833, as if they were ignoring the filter that is being tested
I have problems when graphing the response that the esp32 reads in visual studio, instead of having a bode type function, I have a series of pulses that come from the ad9833, as if they were ignoring the filter that is being tested
You have to understand that there is a real distaste for people who don't know how to code that go and get ChatGPT code and then want us to fix it for them. ChatGPT has been a bit of an issue in these circles and you are spot on indicative of the exact type of user that is the real annoyance with it. I don't mean to be rude, you probably didn't know that when you got here. But that's the reason you're being received the way you are.
We like helping people learn to code. We like helping other coders fond problems. We don't like proofreading for the robot.
If you want to learn to code and write code for yourself then this is the place to come. If you just want the code written for you and ChatGPT isn't good enough then pay someone. If you want ChatGPT code then go ask the robot to fix it.
Please understand that it's nothing personal. If you have specific questions about the code or how it works then certainly feel free to ask them. But you're probably not going to get someone to just fix the ChatGPT code for you. Go back to ChatGPT and keep asking if that's all you want.
It is not personal. Indeed, but I'm new to this, no one helps me and I have to start somewhere, I've already looked for a lot of information in many places, I don't know people in person with the same hobby as me and I haven't had good results...
That's why I decided to come to this forum looking for someone who wants to help a newbie, but now I'm going to continue on my own...
It's obvious that the people who make up this platform are very good at what they do, so it shouldn't have been difficult to read a code written by a computer or anyone else, your answer could have helped me, a shame.
I came to this forum with good intentions to clear up a doubt... and I leave as I came... I didn't know that people in ArduinoForums are so toxic.
It's not strange that a lot of people here has a reputation for being like that... I didn't believe it, but now I do.
you won't see me here anymore, im sorry
now i feel like crap... thanks