Hi,
I have 2 versions of some very simple test code that produces a PWM signal, one uses the Arduino anlogWrite and the other uses SoftPWM. the SoftPWM behaves irattically.
I have added both sets of code and pictures showing the wave forms below. you can see the bottom picture is irratic.
#include "SoftPWM.h"
void setup()
{
//SoftPWMBegin();
//SoftPWMSet(3, 0);
pinMode(3, OUTPUT);
}
void loop()
{
delay(15);
analogWrite(3, 255);
//SoftPWMSet(3, 255);
delay(15);
//SoftPWMSet(3, 0);
analogWrite(3, 0);
}
#include "SoftPWM.h"
void setup()
{
SoftPWMBegin();
SoftPWMSet(3, 0);
//pinMode(3, OUTPUT);
}
void loop()
{
delay(15);
//analogWrite(3, 255);
SoftPWMSet(3, 255);
delay(15);
SoftPWMSet(3, 0);
//analogWrite(3, 0);
}
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
See also FAQ - Arduino Forum for general rules on forum behaviour and etiquette.
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is fru…
Your topic was MOVED to its current forum category as it is more suitable than the original
It certainly looks like SoftPWM is producing bad results.
system
Closed
August 7, 2022, 4:43pm
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.