{"id":33,"date":"2008-01-26T22:15:28","date_gmt":"2008-01-26T13:15:28","guid":{"rendered":"http:\/\/www.atinfinity.info\/blog\/archives\/33"},"modified":"2008-01-27T02:17:14","modified_gmt":"2008-01-26T17:17:14","slug":"gainer-with-c-vol1-2","status":"publish","type":"post","link":"http:\/\/www.atinfinity.info\/blog\/archives\/33","title":{"rendered":"Gainer with C++ vol.1"},"content":{"rendered":"<p><a href=\"http:\/\/www.atinfinity.info\/blog\/archives\/32\" target=\"_blank\">\u524d\u56de<\/a>\u4e88\u544a\u3057\u3066\u3044\u305f\u3088\u3046\u306bC++\u3067Gainer\u3092\u6271\u3046\u305f\u3081\u306b\u884c\u3063\u305f\u51e6\u7406\u3092\u7c21\u5358\u306b\u66f8\u3044\u3066\u307f\u307e\u3059\uff0e<br \/>\n\u3082\u3057\u304b\u3057\u305f\u3089\uff0c\u9593\u9055\u3063\u3066\u3044\u305f\u308a\uff0c\u3053\u3046\u3057\u305f\u65b9\u304c\u826f\u3044\u70b9\u306a\u3069\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u306e\u3067\uff0c\u3054\u6307\u6458\u304a\u9858\u3044\u3057\u307e\u3059\uff0e<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\uff0c\u4eca\u306e\u3068\u3053\u308d\u6700\u4f4e\u9650\u7528\u610f\u3057\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u306f\u3053\u3093\u306a\u611f\u3058\uff0e<\/p>\n<p><strong>\uff08\uff11\uff09Gainer\u521d\u671f\u5316<\/strong><br \/>\n\u901a\u4fe1\u901f\u5ea6\uff0c\u30d1\u30ea\u30c6\u30a3\u7b49\u306e\u8a2d\u5b9a\uff08<a href=\"http:\/\/gainer.cc\/wiki\/index.php?title=Tutorial\/Basic\/Common\/03\/ja\" target=\"_blank\">\u3053\u3061\u3089<\/a>\u3092\u53c2\u8003\uff09<\/p>\n<p><strong>\uff08\uff12\uff09\u30ea\u30bb\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1<\/strong><br \/>\nGainer\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u6587\u5b57\u5217\u300cQ*\u300d \u3092\u9001\u4fe1\uff0e<br \/>\n\uff08\u9001\u4fe1\u306b\u6210\u529f\u3057\u305f\u3089Gainer\u5074\u304b\u3089\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u9001\u3089\u308c\u308b\u306e\u3067\u53d7\u3051\u53d6\u308b\uff09<\/p>\n<p><strong>\uff08\uff13\uff09\u30b3\u30f3\u30d5\u30a3\u30ae\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a<\/strong><br \/>\nGainer\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u6587\u5b57\u5217\u300cKONFIGURATION_1*\u300d\u3092\u9001\u4fe1\uff0e<br \/>\n\uff08\u9001\u4fe1\u306b\u6210\u529f\u3057\u305f\u3089Gainer\u5074\u304b\u3089\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u9001\u3089\u308c\u308b\u306e\u3067\u53d7\u3051\u53d6\u308b\uff09<\/p>\n<p><strong>\uff08\uff14\uff09\u30c7\u30fc\u30bf\u306e\u53d6\u5f97<\/strong><br \/>\nGainer\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u6587\u5b57\u5217\u300cI*\u300d\u3092\u9001\u4fe1\uff0e<br \/>\n\u9001\u4fe1\u306b\u6210\u529f\u3057\u305f\u3089\uff0c\u30a2\u30ca\u30ed\u30b0\u5165\u529bain0\uff5eain3\u306e\u30c7\u30fc\u30bf\u304c\u6587\u5b57\u5217\u3068\u3057\u3066<br \/>\n\u9001\u3089\u308c\u3066\u304f\u308b\u306e\u3067\uff0c\u305d\u306e\u6587\u5b57\u5217\u3092\u53d7\u4fe1\uff0e<\/p>\n<p><strong>\uff08\uff15\uff09\u6587\u5b57\u5217\u2192\u6570\u5024\u5909\u63db<\/strong><br \/>\n\u53d7\u4fe1\u3057\u305f\u30a2\u30ca\u30ed\u30b0\u5165\u529b\u306e\u30c7\u30fc\u30bf\u306f\uff0c\u300cIxx\u2026xx*\u300d\uff08\u203bxx\u2026xx\u304c\u30c7\u30fc\u30bf\u90e8\uff09<br \/>\n\u3068\u3044\u3046\u69cb\u6210\u306e\u6587\u5b57\u5217\u306a\u306e\u3067\uff0c\u307e\u305a\u306f\u5165\u529b\u5206\u3060\u3051\u6587\u5b57\u5217\u3092\u5206\u5272\uff0e<br \/>\n\u307e\u305f\uff0c\u5024\u306f16\u9032\u306a\u306e\u306710\u9032\u306b\u5909\u63db\u3057\u3066\u5229\u7528\uff0e<\/p>\n<p><strong>\uff08\uff16\uff09\u5f8c\u51e6\u7406<\/strong><br \/>\n\u30dd\u30fc\u30c8\u306e\u30af\u30ed\u30fc\u30ba\u51e6\u7406\uff0e<\/p>\n<p>************************<br \/>\n\u3042\u3068\uff0c\u300c\u30d7\u30ed\u30b0\u30e9\u30e0\u98a8\u300d\u306b\u66f8\u304f\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059\uff0e<br \/>\n\u203b\u524d\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3053\u308c\u3089\u306e\u51e6\u7406\u306b\u79fb\u52d5\u5e73\u5747\u6cd5\u306e\u51e6\u7406\u3082\u52a0\u3048\u3066\u3044\u307e\u3059\uff0e<\/p>\n<p>[cpp]<br \/>\n#include &#8220;MyGainer.h&#8221;\t\/\/\u30d8\u30c3\u30c0\u306e\u30a4\u30f3\u30af\u30eb\u30fc\u30c9<br \/>\nMyGainer *gainer;<\/p>\n<p>int main(int argc, char** argv)<br \/>\n{<br \/>\n\t\/\/Gainer\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u751f\u6210<br \/>\n\t\/\/\u3053\u3053\u3067\u306fCOM3\u3092\u6307\u5b9a<br \/>\n\tgainer = new MyGainer(3);<\/p>\n<p>\t\/\/\u521d\u671f\u5316<br \/>\n\t\/\/\uff08COM\u30dd\u30fc\u30c8\u30aa\u30fc\u30d7\u30f3\u3001\u901a\u4fe1\u901f\u5ea6\u7b49\u8a2d\u5b9a\uff09<br \/>\n\tgainer->initialize();<\/p>\n<p>\t\/\/\u30b3\u30f3\u30d5\u30a3\u30ae\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\uff08MODE1\uff09<br \/>\n\tgainer->setConfiguration(1);<\/p>\n<p>\t\/\/\u30ad\u30fc\u5024<br \/>\n\tint key = 0;<\/p>\n<p>\t\/\/\u30eb\u30fc\u30d7<br \/>\n\twhile(1)<br \/>\n\t{<br \/>\n\t\t\/\/\u30c7\u30fc\u30bf\u53d6\u5f97<br \/>\n\t\t\/\/\uff08\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1 + \u30c7\u30fc\u30bf\u53d7\u4fe1 + \u6587\u5b57\u5217\u2192\u6570\u5024\uff09<br \/>\n\t\tgainer->getAllAnalogInput();<\/p>\n<p>\t\t\/\/\u30ad\u30fc\u5165\u529b\u5f85\u3061(1msec)<br \/>\n\t\tkey = getKeyInput();<\/p>\n<p>\t\t\/\/ESC\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u7d42\u4e86<br \/>\n\t\tif(key == 0x1b)<br \/>\n\t\t{<br \/>\n\t\t\tbreak;<br \/>\n\t\t}<br \/>\n\t}<\/p>\n<p>\t\/\/\u5f8c\u51e6\u7406\uff08COM\u30dd\u30fc\u30c8\u89e3\u653e\uff09<br \/>\n\tgainer->release();<br \/>\n\tdelete gainer;<\/p>\n<p>\treturn 0;<br \/>\n}[\/cpp]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u4e88\u544a\u3057\u3066\u3044\u305f\u3088\u3046\u306bC++\u3067Gainer\u3092\u6271\u3046\u305f\u3081\u306b\u884c\u3063\u305f\u51e6\u7406\u3092\u7c21\u5358\u306b\u66f8\u3044\u3066\u307f\u307e\u3059\uff0e \u3082\u3057\u304b\u3057\u305f\u3089\uff0c\u9593\u9055\u3063\u3066\u3044\u305f\u308a\uff0c\u3053\u3046\u3057\u305f\u65b9\u304c\u826f\u3044\u70b9\u306a\u3069\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u306e\u3067\uff0c\u3054\u6307\u6458\u304a\u9858\u3044\u3057\u307e\u3059\uff0e \u3068\u3044\u3046\u3053\u3068\u3067\uff0c\u4eca\u306e\u3068\u3053\u308d\u6700\u4f4e\u9650\u7528\u610f &hellip; <a href=\"http:\/\/www.atinfinity.info\/blog\/archives\/33\">\u7d9a\u304d&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":0,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.atinfinity.info\/blog\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}