Go Down

Topic: Arduino PWM Visual C# (Read 669 times) previous topic - next topic

ionut77

Dec 03, 2017, 03:11 pm Last Edit: Dec 03, 2017, 03:17 pm by ionut77
Hello everyone,

I am new on this forum, and maybe someone can help me with a problem.
I am trying to change a program to control an arduino mega from computer program. I must tell you I am a beginner in programming.

The problem is  I want to control pin 2 of an arduino mega with computer software (PWM) and I don't know how do do it
Thank you in advance for help!
Below is the arduino program and visual c# files

Robin2

What is in the huge ZIP file?  I don't like opening unknown ZIP files.

If you want help with an Arduino program why not just post the .ino file?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

ionut77

Hello ,
I have attached the ino file and a text with visual studio program.


Robin2

Your Arduino program is not using Pin 2 for anything.

You need to provide more information about what you are trying to achieve.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

ionut77

I just want to control, for example pin 2 of arduino mega with PWM.

Robin2

Then you need a line of code like this
Code: [Select]
analogWrite(2, N);
where N is a value from 0 to 255


If that is not the sort of answer you are looking for you should re-read Reply #3 and think of the bigger picture.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up