I have built this circuit. I have a small DC motor and encoder disk is attached to it. I need a program so the RPM and Direction of rotation will display on 16x2 LCD display. The circuit diagram and original pictures are here.
Please Can anyone write a program for me.
I will be very thankful to you.
Yes, but why do you not want to write the program yourself? The strength of Arduino is that you can learn about circuits and programming.
If you do not write the program, I guess you can score only 40 of the 80 marks available. That will not be enough for a pass.
Good work on drawing a schematic of your circuit. However, I would recommend that you connect the encoder to pins 2, 3. These 2 pins alone on Uno have a special function that will be important.
I don't have any knowledge about programing and also the time is running out so I don't have time to learn how to program. So can you or anyone write a program for me.
Will be appreciated .
I have used chatgpt but there are errors in the code and I don't know how to modify the program because as I have said I don't know programming.
So please write a program for meπ
Were you born with the ability to draw schematics and build circuits? No, I suspect you have learned that. If you can learn that, you can learn to program.
Is this a class assignment?
How long have you got to complete it?
How long ago was this set?
We do not do this, especially for class assignments. It is called cheating.
If you want to cheat this way you can move the post to the section that offers to write code for you in exchange for payment. Say how much you are willing to pay to cheat.
No it's is not related to school or college project. I am making this at home. I have this project last year but due to programing issues I cannot completed it. But now I want that to complete. Please write a program so that I can learn from the program.
This is not a cheating. It's my personal project.
The error is strange. Normally the IDE creates forward declarations for functions so that it is not necessary to declare a function before it is used. I know there are limitations to what types of functions the IDE can do this for (variadic functions, for example) but I don't see anything like that here.
Try moving the definition of pulseCounter() to before setup().
The big problem in the code you posted in post #9 is that it does not include the LCD library once all the LCD commands are commented out the to code as written compiles.
The other big problem is this line:-
When you use a variable this size you need to disable the interrupts read the variable and re-enable the interrupts again. This is so you don't get an interrupt altering the value of pulseCount when you are part way through reading it. This is required for all volatile variables greater than one byte.
This will probably lead to missed interrupts causing a shortfall in the readings you get.