How to set pwm on stm8?
what pin i can use for pwm?
i looked documentation but i see nothing about it, or example, is it supported?
is possible use st-link to debug?
it's my first project with stm8 & a sduino
thanks
pwm
Re: pwm
Hi, the sduino wiki includes the documentation that you are asking:
https://tenbaht.github.io/sduino/hardware/stm8blue/
It's as straight forward as it sounds, I ran this code using an analog pin and a pwm too:
it works, of course.
https://tenbaht.github.io/sduino/hardware/stm8blue/
It's as straight forward as it sounds, I ran this code using an analog pin and a pwm too:
Code: Select all
/* STM8.ANALOG.PWM; */
byte LED=PC3;//.pwm;
byte ap=PC4;//.Analog;
void setup(void){
pinMode(ap,INPUT);
pinMode(LED,OUTPUT);
}
void loop(void){
int c=analogRead(ap);
analogWrite(LED,map(c,0,1023,0,255));
delay(100);
}