Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Arduino Uno, PWM output is possible on digital I/O pins 3, 5, 6, 9, 10 and 11.
- #define pwmPinOutput 11
- float voltageNeededToOutput = 0.549;//1.798;
- float analogPWMoutput = 0;
- void setup() {
- Serial.begin(9600);
- pinMode(pwmPinOutput, OUTPUT);
- }
- void loop() {
- analogPWMoutput = ((voltageNeededToOutput*255.00)/(5.00));
- Serial.println(int(analogPWMoutput));
- analogWrite(pwmPinOutput, int(analogPWMoutput));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement