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 = 1.798;
- float analogPWMoutput = 0;
- void setup() {
- Serial.begin(9600);
- pinMode(pwmPinOutput, OUTPUT);
- }
- void loop() {
- analogPWMoutput = map(voltageNeededToOutput, 0, 5, 0, 255);
- analogWrite(pwmPinOutput, analogPWMoutput);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement