- 追加された行はこの色です。
- 削除された行はこの色です。
#freeze
閲覧総計:&counter(); (本日:&counter(today); 昨日:&counter(yesterday);)
*スイッチ入力(12F683) [#dd4fa543]
12F683(8ピンPIC)でスイッチ入力(スイッチのオン(ON)、オフ(OFF)信号をPICに取り込む)
を実現する場合、多くの項目の初期設定を行う必要がある。
その実例を紹介します。 07/02/12
1.内部発振器を8MHzで使用
2.各ピンをデジタル入出力で使用
ANSEL = 0b00000000; //GP0-5をデジタル利用に設定
CMCON0 = 0b00000111; //コンパレータを使わない
3.信号入力ピンを内部プルアップする
OPTION_REG.NOT_GPPU = 0; //内部プルアップ利用に設定
WPU = 0b00000100; //GP2を内部プルアップ
|&attachref(P1010295.JPG,zoom,150x150,button){新しい写真添付};|&attachref(,zoom,150x150,button){新しい写真添付};|
/**
* スイッチ入力
* (スイッチを押している間だけON、はなすとOFF)
*
* LED: GP4 スイッチ: GP2
*Clock: 8.0MHz 内蔵発振器使用
*Device Flags:
* _CP_OFF _MCLRE_OFF _PWRTE_ON _WDT_OFF _INTRC_OSC_NOCLKOUT
*
* MikroC v2.1
*/
void main() {
TRISIO = 0b00000100; //GP2を1:入力に、他を0:出力設定
//内蔵発振器 8MHz使用に設定
OSCCON.IRCF2=1;
OSCCON.IRCF1=1;
OSCCON.IRCF0=1;
ANSEL = 0b00000000; //GP0〜5をデジタル利用に設定
OPTION_REG.NOT_GPPU = 0; //内部プルアップ利用に設定
WPU = 0b00000100; //GP2を内部プルアップ
GPIO = 0b00000000; //GPIOの中身をきれいにする
CMCON0 = 0b00000111; //コンパレータを使わない
do {
if(Button(&GPIO, 2, 1, 0)) { //スイッチONの場合
GPIO.F4 = 1; //LED ON
} else { //スイッチOFFの場合
GPIO.F4 = 0; //LED OFF
}
}while(1);
}
★この情報は役に立ちましたか?
#vote(はい[12],普通[5],いいえ[5])
- ボタン関数は使ったこと無いな〜 参考になります。 -- [[むっちゃん]] &new{2008-02-21 (木) 15:26:08};
- LZyhTs <a href="http://vwusscatpdtj.com/">vwusscatpdtj</a>, [url=http://zxrzmrdzoqjz.com/]zxrzmrdzoqjz[/url], [link=http://rkcscrbipejx.com/]rkcscrbipejx[/link], http://auhbxwbdedjn.com/ -- [[lxgzty]] &new{2010-03-09 (火) 13:59:25};
- Q1WZQI <a href="http://pjdvceinjdjm.com/">pjdvceinjdjm</a>, [url=http://aeizlzwnlnag.com/]aeizlzwnlnag[/url], [link=http://vzwdeumziphl.com/]vzwdeumziphl[/link], http://rljoumprajym.com/ -- [[rsvscz]] &new{2010-03-09 (火) 14:07:13};
- rpr2w7 <a href="http://aketxpgtexhm.com/">aketxpgtexhm</a>, [url=http://dodnhnuvkncn.com/]dodnhnuvkncn[/url], [link=http://avtnbocfnipb.com/]avtnbocfnipb[/link], http://wzlyqpklfgic.com/ -- [[awhqkp]] &new{2010-03-10 (水) 18:29:37};
- VITDtj <a href="http://kiunjmtvnjrb.com/">kiunjmtvnjrb</a>, [url=http://jycuffvmvrtv.com/]jycuffvmvrtv[/url], [link=http://pldtzrzxfbdc.com/]pldtzrzxfbdc[/link], http://daluetwtqzqj.com/ -- [[jlarkipxwz]] &new{2010-03-10 (水) 18:30:11};
- QAPT2a <a href="http://pqlafvtvigwv.com/">pqlafvtvigwv</a>, [url=http://hmniorlyksut.com/]hmniorlyksut[/url], [link=http://gdjceskzzvdg.com/]gdjceskzzvdg[/link], http://brqgpldwwino.com/ -- [[mjldlib]] &new{2010-03-15 (月) 08:53:23};
- QAPT2a <a href="http://pqlafvtvigwv.com/">pqlafvtvigwv</a>, [url=http://hmniorlyksut.com/]hmniorlyksut[/url], [link=http://gdjceskzzvdg.com/]gdjceskzzvdg[/link], http://brqgpldwwino.com/ -- [[mjldlib]] &new{2010-03-15 (月) 08:54:00};
- QzvYxT <a href="http://ztvfdqknigyv.com/">ztvfdqknigyv</a>, [url=http://htvqbmeewqho.com/]htvqbmeewqho[/url], [link=http://auzzeouvosht.com/]auzzeouvosht[/link], http://avwqahmbqbdr.com/ -- [[qgwyhcqznx]] &new{2010-03-16 (火) 18:30:45};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=cheap%20viagra viagra 8-OOO http://www.armenian.com/cgi-bin/links.cgi?searchstring=generic%20cialis cialis =))) -- [[Caxjepfp]] &new{2010-03-20 (土) 03:09:20};
- http://www.ratemds.com/filecache/doctor-ratings.jsp?did=957853&option=viagra#1 viagra %]]] http://www.stlouisbusinesslist.com/business/5021837.htm?info=viagra viagra %DD -- [[Vxunsaeq]] &new{2010-03-20 (土) 18:45:39};
- http://www.ratemds.com/doctor-ratings/957857/LA/Los-Angeles/Adacialisoli?tag=cialis cialis >:-[ http://www.armenian.com/cgi-bin/links.cgi?searchstring=cialis%20store cialis 8-((( -- [[Kxoebqlf]] &new{2010-03-21 (日) 10:46:59};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=cheap%20cialis cialis %-))) http://www.ratemds.com/filecache/doctor-ratings.jsp?did=957853&option=viagra viagra :-(( http://www.armenian.com/cgi-bin/links.cgi?searchstring=cialis%20store cialis %(( -- [[Qibxhvmz]] &new{2010-03-21 (日) 10:47:34};
- http://www.stlouisbusinesslist.com/business/5021837.htm?info=viagra generic viagra 8[ http://www.armenian.com/cgi-bin/links.cgi?searchstring=buy%20viagra generic viagra :]] -- [[Dosedakh]] &new{2010-03-22 (月) 09:48:16};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=viagra cheap viagra 8-[ http://www.jobzilla.ca/details/company/2507/search/?opt=viagra buy viagra >:-] -- [[Icytzrbm]] &new{2010-03-22 (月) 11:03:04};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=viagra cheap viagra 8]]] http://www.ratemds.com/doctor-ratings/957857/LA/Los-Angeles/Adacialisoli?tag=cialis generic cialis =-OO -- [[Cwbvmwnk]] &new{2010-03-24 (水) 12:29:22};
- http://www.ratemds.com/filecache/doctor-ratings.jsp?did=957853&option=viagra#1 buy viagra 8( http://www.armenian.com/cgi-bin/links.cgi?searchstring=cialis cheap cialis 8)) -- [[Busaolgt]] &new{2010-03-24 (水) 12:31:43};
- http://www.ratemds.com/filecache/doctor-ratings.jsp?did=957853&option=viagra#1 buy viagra >:[ http://www.ratemds.com/doctor-ratings/957857/LA/Los-Angeles/Adacialisoli?tag=cialis buy cialis :-OOO -- [[Raknjdqi]] &new{2010-03-25 (木) 09:12:42};
- http://www.hotfrog.ca/Companies/Canadian-viagra-distributions generic viagra 8-PP http://www.armenian.com/cgi-bin/links.cgi?searchstring=viagra generic viagra %-DDD -- [[Tvatbfku]] &new{2010-03-26 (金) 07:07:55};
- http://www.hotfrog.ca/Companies/Canadian-viagra-distributions viagra %PPP -- [[Imzgswnm]] &new{2010-03-27 (土) 08:16:43};
- http://www.ratemds.com/filecache/doctor-ratings.jsp?did=957857&option=cialis cialis %-[[ -- [[Sbeddefy]] &new{2010-03-27 (土) 08:16:51};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=buy%20viagra viagra =-D -- [[Wqfbbrxa]] &new{2010-03-27 (土) 08:16:52};
- http://www.ratemds.com/doctor-ratings/957853/NY/New-York/Lousanne?tag=viagra viagra >:-PPP -- [[Kprwozwu]] &new{2010-03-27 (土) 09:41:34};
- http://www.jobzilla.ca/details/company/2507/search/?opt=viagra viagra >:-)) -- [[Otkdiljj]] &new{2010-03-28 (日) 10:53:00};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=viagra%20store viagra :]]] -- [[Alitmktc]] &new{2010-03-28 (日) 10:53:29};
- http://www.uk-local-search.co.uk/search.aspx?q=royal%20viagra viagra :-PPP -- [[Stknckoe]] &new{2010-03-28 (日) 10:54:03};
- http://www.hotfrog.ca/Companies/Canadian-viagra-distributions viagra >:DDD -- [[Avnlbrwd]] &new{2010-03-28 (日) 10:54:34};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=noprescription%20cialis cialis :-[[ -- [[Rgpmzhmd]] &new{2010-03-28 (日) 10:54:38};
- http://www.findtheneedle.co.uk/company-telephone.asp?telephone=4438443434 canadian pharmacy >:-( -- [[Bqqrvuyf]] &new{2010-03-28 (日) 10:54:54};
- http://www.uk-local-search.co.uk/search.aspx?q=royal%20viagra viagra >:]] -- [[Eurgifpx]] &new{2010-03-29 (月) 13:13:22};
- http://www.stlouisbusinesslist.com/category/business.asp?uid=5021837&function=interview viagra =]] -- [[Mhzbyxdx]] &new{2010-03-29 (月) 13:13:24};
- http://www.uk-local-search.co.uk/search.aspx?q=royal%20viagra viagra >:-DDD -- [[Tpvvresp]] &new{2010-03-29 (月) 13:13:27};
- http://www.hotfrog.ca/Companies/Canadian-viagra-distributions viagra =-(( -- [[Xunvzrto]] &new{2010-03-29 (月) 13:13:31};
- http://www.findtheneedle.co.uk/products/2700385-buy-cheap-viagra-pack.asp viagra =-[[ -- [[Yinbqzrq]] &new{2010-03-29 (月) 13:13:34};
- http://www.uk-local-search.co.uk/business/buy+viagra+cheap+generic/1851115/ viagra =( -- [[Hgbcsjrl]] &new{2010-03-29 (月) 13:13:39};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=cialis%20store cialis =[ -- [[Ignphvpt]] &new{2010-03-29 (月) 13:13:43};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=cialis%20store cialis 8-( -- [[Skevfsim]] &new{2010-03-29 (月) 13:13:51};
- http://www.stlouisbusinesslist.com/category/business.asp?uid=5021837&function=interview viagra =-PP -- [[Bhuutzbp]] &new{2010-03-29 (月) 13:14:05};
- http://www.armenian.com/cgi-bin/links.cgi?searchstring=cialis%20pills cialis 8-[[ -- [[Jtiqopmu]] &new{2010-03-29 (月) 13:14:07};
- http://www.psu.com/forums/member.php?u=224297 tramadol purchase =OOO -- [[Tgborsas]] &new{2010-04-09 (金) 15:28:34};
- http://www.psu.com/forums/member.php?u=224294 tramadol prescription :-P -- [[Uraxuvnl]] &new{2010-04-09 (金) 15:28:39};
- http://www.psu.com/forums/member.php?u=224293 order tramadol 8-[[[ -- [[Lhnuinsj]] &new{2010-04-09 (金) 15:28:48};
- http://www.psu.com/forums/member.php?u=224294 tramadol prescription 8-(( -- [[Pbbepfes]] &new{2010-04-09 (金) 15:28:54};
- http://www.psu.com/forums/member.php?u=224293 order tramadol =DD -- [[Vuczncmx]] &new{2010-04-10 (土) 00:49:16};
- http://www.psu.com/forums/member.php?u=224296 soma :O -- [[Cdhqgwjn]] &new{2010-04-10 (土) 01:18:06};
- http://www.psu.com/forums/member.php?u=224297 tramadol purchase >:D -- [[Clmslprj]] &new{2010-04-10 (土) 01:18:52};
- http://www.psu.com/forums/member.php?u=224291 tramadol online =[ -- [[Cgqmtzqc]] &new{2010-04-10 (土) 10:21:08};
- http://www.psu.com/forums/member.php?u=224296 soma 8] -- [[Aubrmvcq]] &new{2010-04-10 (土) 10:21:38};
- http://www.psu.com/forums/member.php?u=224297 tramadol purchase :PPP -- [[Mfpttzbs]] &new{2010-04-10 (土) 10:22:19};
- http://www.psu.com/forums/member.php?u=224297 tramadol purchase 8-PP -- [[Qmqebjqw]] &new{2010-04-10 (土) 19:18:50};
- http://www.psu.com/forums/member.php?u=224294 tramadol prescription 8-OO -- [[Bjtkwxev]] &new{2010-04-10 (土) 19:19:08};
- http://www.psu.com/forums/member.php?u=224291 tramadol online =D -- [[Mmlduwgc]] &new{2010-04-10 (土) 19:19:23};
- jpUiMgim -- [[xiygnmk]] &new{2010-04-15 (木) 16:51:09};
- http://forum.french-football.com/profile.php?id=28906 soft cialis 8-( http://antifanboyfed.portbb.com/profile.php?id=22784 tramadol :(( http://www.scoopex.biz/forum/profile.php?id=14757 viagra %((( http://thecity.sfsu.edu/%7Ecsc211/punbb/profile.php?id=18922 tadalafil =)) -- [[Vlxqgfyo]] &new{2010-05-18 (火) 21:36:34};
- http://s257532017.online.de/index.php?action=profile;u=17214 cialis =-]]] http://ldpc.portbb.com/profile.php?id=22776 generic tadalafil 8]] http://www.effectiveprototyping.com/book/forums/profile.php?id=23137 viagra 8-] http://bordellen.portbb.com/profile.php?id=21194 discount tramadol %-) -- [[Tfkmoouv]] &new{2010-05-20 (木) 16:23:47};
- http://stablesandchairs.com/forum/profile.php?id=44922 tadalafil >:-DD http://www.michigan-walleye.com/forum/profile.php?id=56361 tadalafil :-D http://ssworld.portbb.com/profile.php?id=15856 viagra 8-) http://freetracfoneringtones.portbb.com/profile.php?id=11558 tadalafil >:[[ -- [[Sfbejjvm]] &new{2010-05-22 (土) 18:24:59};
- xIhtiM <a href="http://xsqpbjgddutu.com/">xsqpbjgddutu</a>, [url=http://fbotvplftsjt.com/]fbotvplftsjt[/url], [link=http://obvzusgssaww.com/]obvzusgssaww[/link], http://hzasfnmjpbxn.com/ -- [[tdilhiarcdu]] &new{2010-07-02 (金) 01:15:43};
- tcUO84 <a href="http://wwrnjcgvfmjj.com/">wwrnjcgvfmjj</a>, [url=http://adypkzbdeksl.com/]adypkzbdeksl[/url], [link=http://xbrarhbcxjuh.com/]xbrarhbcxjuh[/link], http://cbiufcdyxnus.com/ -- [[hktgor]] &new{2010-07-02 (金) 18:38:21};
- comment1, http://andrecastel.com Accutane, http://columbiarealestatenews.com Viagra, http://connersvilleheatingandcooling.com Levitra, http://claraboya.net Ambien, -- [[Acomplia]] &new{2010-08-05 (木) 06:00:52};
- comment1, http://columbiarealestatenews.com Viagra, http://claudiaconduto.com Lexapro, -- [[Viagra]] &new{2010-08-05 (木) 06:02:52};
#comment