View previous topic :: View next topic |
Author |
Message |
atoo
Joined: 31 Jan 2014 Posts: 32
|
RGB control |
Posted: Fri Mar 07, 2014 4:54 am |
|
|
Did that change an RGB LED
with two colors per timer2 and PWM
someone has a simple example to change the color of the RGB LED
without having to use CCP1 module only timer2 and duty cycle
Simple simple simple ... etc. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Fri Mar 07, 2014 5:39 am |
|
|
Do a search for software PWM on this forum. It's been done loads of times before.
As with your previous posts, if/when you get stuck, show us what you've done, then someone here will help.
We're NOT going to give you the answers.
Mike |
|
|
atoo
Joined: 31 Jan 2014 Posts: 32
|
Atoo |
Posted: Fri Mar 07, 2014 6:24 am |
|
|
of course not,
is logical
I do not want work to be done
already be prepared
only information that leads to a solution
grateful |
|
|
atoo
Joined: 31 Jan 2014 Posts: 32
|
atoo |
Posted: Mon Mar 10, 2014 4:27 pm |
|
|
Code: |
I found the PWM module in mikroC
Only people that someone translate for CCS C
because I'm beginner and would like to test !!
|
|
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
|
atoo
Joined: 31 Jan 2014 Posts: 32
|
Atoo |
Posted: Tue Mar 11, 2014 2:52 am |
|
|
dyeatman
I did not choose the mikro c
but the ccs c language
is the best ...
I would then translate mikro c for CCS C
as is, of mikro c for CCS C?
see the code
Code: |
void main()
{
pwm1_init(10000); //configura o PWM para freq de 10Khz
pwm1_set_duty(128); //seta duty cycle para 50%
pwm1_start(); //inicia geração do pulso
delay_ms(100); //espera 100 milissegundos
pwm1_stop(); // Para a geração do pulso
pwm1_set_duty(192); //seta duty cycle para 75%
pwm1_start(); //inicia geração do pulso
}
|
Thanks for the post and attention. |
|
|
atoo
Joined: 31 Jan 2014 Posts: 32
|
Atoo |
Posted: Tue Mar 11, 2014 6:00 pm |
|
|
Someone ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9228 Location: Greensville,Ontario
|
|
Posted: Wed Mar 12, 2014 5:55 am |
|
|
You need to show us the entire program, not just a bit of it. WE have no idea which PIC you're using or your compiler version.
While I do have mikroCpro, CCS is FAR easier to understand and program with.
I know that English may be your second language and that the 'search' feature of this forum has a couple 'quirks'. It just takes practice to find what you want.
As previously stated, there are several programs on the forum.
hth
jay |
|
|
atoo
Joined: 31 Jan 2014 Posts: 32
|
|
Posted: Wed Mar 12, 2014 2:16 pm |
|
|
no no, I just want to translate to CCS C
I people please! earnestly !
as it would be in CCS C ? the code ? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Mar 12, 2014 2:26 pm |
|
|
We are not going to translate the code for you.
Go off by yourself, learn MikroC and CCS, and you do the translation.
Do not protest, do not beg for help, just learn to program and do it.
That's what the rest of us did. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Wed Mar 12, 2014 3:50 pm |
|
|
allow me to let the rules of the forum do the talking:
3. Before posting a question, look for the answer first
4. When asking for help, please give as much relevant information as you can.
let me say in the kindest and most mindful way,
that I am positively encouraged to get involved
when the original poster has shown initiative and exerted
some effort to solve their own problem.
Revealing significant source code ,
a schematic where appropriate ,
and above all showing some patience -
is most likely to make me expend the time to respond.
language skill has little to do with it
INITIATIVE and personal effort-to-solve are the key. |
|
|
atoo
Joined: 31 Jan 2014 Posts: 32
|
|
Posted: Wed Mar 12, 2014 4:22 pm |
|
|
I understand
it's all right
|
|
|
|