- 追加された行はこの色です。
- 削除された行はこの色です。
#freeze
閲覧総計:&counter(); (本日:&counter(today); 昨日:&counter(yesterday);)~
~
後関氏の「電子工作の実験室」ページには、CCS C言語によるPICプログラミング~
のサンプルソースが多数掲載されています。~
http://picfun.com/ctechframe.html~
CCS C言語で書かれたソースを「MikroC」に書き換える際のポイントを~
紹介します。~
~
~
**入出力ピンの制御方法 [#k3a4436f]
http://picfun.com/c06.html
***出力【変数レジスタとして制御する方法】 [#dd5b9c34]
http://picfun.com/c06.html の1例目
/**
* CCS C → MikroC書き換え例題1
* LEDの点滅
*【変数レジスタとして制御する方法】
*
* PIC 16F84A
* 発信器 10MHz
* 言語 MikroC v2.1
* Device Flags: _CP_OFF _PWRTE_ON _WDT_OFF _HS_OSC
*
* PortB 0:LED
*/
//MikroCではCCS Cの#記述部が不要
//#device PIC16F84
//#use delay(clock=10000000)
//#byte port_b=6
void main(){
TRISB = 0; //set all output
while(1){ //endless
PORTB = 0xff; //all led on 0と1が逆
Delay_ms(500); //wait 0.5sec
PORTB = 0; //all led off 0と1が逆
Delay_ms(500);
}
}
★この情報は役に立ちましたか?
#vote(はい[5],いいえ[2])
- best work man great <a href=" http://www.volny.cz/siske/euro-sex-party.html ">euro sex party</a> :PP <a href=" http://www.volny.cz/siske/porn-cheerleaders.html ">porn cheerleaders</a> 76441 <a href=" http://www.volny.cz/toper/hardcocks.html ">hardcocks</a> voqz <a href=" http://www.volny.cz/piske/horny-teens-fucking.html ">horny teens fucking</a> 409 <a href=" http://www.volny.cz/vtope/adultflashgames.html ">adultflashgames</a> jmzofm <a href=" http://www.volny.cz/pezda/bigpussy.html ">bigpussy</a> 773912 <a href=" http://www.volny.cz/siske/fuck-a-teen.html ">fuck a teen</a> %]]] <a href=" http://www.volny.cz/pezda/mother-fucking-girls.html ">mother fucking girls</a> jklltn <a href=" http://www.volny.cz/siske/query.html ">query</a> 739400 <a href=" http://www.volny.cz/piske/young-naked-boys.html ">young naked boys</a> pcxx -- [[marla]] &new{2008-03-29 (土) 21:56:11};
- spam_39.txt;10;10 -- [[IumWKfKYJu]] &new{2008-03-30 (日) 02:53:04};
- good job man <a href=" http://www.volny.cz/piske/mature-xxx.html ">mature xxx</a> 1421 <a href=" http://www.volny.cz/toper/xxxstockings.html ">xxxstockings</a> rpn <a href=" http://www.volny.cz/siske/lesbian-orgy.html ">lesbian orgy</a> =O <a href=" http://www.volny.cz/pezda/sandrateenmodel.html ">sandrateenmodel</a> %OO <a href=" http://www.volny.cz/toper/movieshark.html ">movieshark</a> 9731 <a href=" http://www.volny.cz/siske/youngest-pussy.html ">youngest pussy</a> fpings <a href=" http://www.volny.cz/siske/lesbian-pussy.html ">lesbian pussy</a> 584 <a href=" http://www.volny.cz/piske/teen-sex.html ">teen sex</a> 092 <a href=" http://www.volny.cz/toper/xxxyoutube.html ">xxxyoutube</a> 83717 <a href=" http://www.volny.cz/pezda/women-fucking-animals.html ">women fucking animals</a> =] -- [[john]] &new{2008-03-30 (日) 02:53:55};
#comment
~
***出力【ビット制御関数による制御方法】 [#x02bbe6c]
http://picfun.com/c06.html の2例目
/**
* CCS C → MikroC書き換え例題2
* LEDの点滅
*【ビット制御関数による制御方法】
*/
//MikroCではCCS Cの#記述部が不要
//#include <16f84.h>
//#use delay(clock=10000000)
void main(){
TRISB = 0; //set all output
while(1){ //endless loop
PORTB.F0 = 1; //led on
Delay_ms(500);
PORTB.F0 = 0; //led off
Delay_ms(500);
}
}
★この情報は役に立ちましたか?
#vote(はい[1],いいえ[0])
#comment
~
***入力【変数レジスタとして制御する方法】 [#qea5869a]
http://picfun.com/c06.html の3例目
/**
* CCS C → MikroC書き換え例題3
* スイッチ入力 LED点灯
*【変数レジスタとして入力する方法】
*/
//MikroCではCCS Cの#記述部が不要
//#device PIC16F84
//#byte port_a=5
//#byte port_b=6
void main(){
TRISA = 0xff; //set all input
TRISB = 0; //set all output
while(1){ //endless
PORTB = PORTA;
}
}
★この情報は役に立ちましたか?
#vote(はい[0],いいえ[0])
#comment
~
***入力【ビット制御関数による制御方法】 [#l8c54e51]
http://picfun.com/c06.html の4例目
/**
* CCS C → MikroC書き換え例題4
* スイッチ入力 LED点灯
*【ビット制御関数により入力する方法】
*/
//MikroCではCCS Cの#記述部が不要
//#include <16f84.h>
void main(){
TRISA = 0xff;
TRISB = 0;
//MikroCではCCS Cの#記述部が不要
//#use fast_io(a)
//#use fast_io(b)
while(1){ //endless
PORTB.F0 = PORTA.F0;
}
}
★この情報は役に立ちましたか?
#vote(はい[0],いいえ[0])
#comment