é¡ä¼¼ç»åãæ¤ç´¢ããæ¹æ³ã調ã¹ã¿ã ãã®1
Googleç»åæ¤ç´¢ã®ãããªé¡ä¼¼ç»åãæ¤ç´¢ããæ¹æ³ã調ã¹ã¦ã¿ãã
ã±ã£ã¨æãã¤ãã®ã¯ãè²ãå½¢ç¶ãªã©ã®ç¹å¾´éãæ¯è¼ããè¿ä¼¼ãã¦ãããã®ã調ã¹ã¦ããæ¹æ³ã ã
ãã®æã®æ
å ±ãã©ã¤ãã©ãªã¯ããã£ããåºåã£ã¦ããã®ã§ãä¸çªãæ軽ã«ã§ãããã ã
ä»ã®ã¢ããã¼ãã¨ãã¦ã¯ãç¹å¾´éãè¿ä¼¼ãã¦ããªããã®ãæ¢ããããã¨ã§ãé¡ä¼¼æ§ãå¤å®ããæ¹æ³ãããããã ã
ç»åå士ãã¤ããããã¦é¡ä¼¼æ§ãå¤å®ããã®ã§ã¯ãªããå½¼ãã¯åé¡ãã¾ã£ããå¥ã®è§åº¦ããæãããå½¼ãã®æ¹æ³ã§ã¯ãã¿ã¼ã²ããã®ç»å(A)ã大éã®ã©ã³ãã ãªç»åã¨æ¯è¼ãã¦ããããã¨å½ã®ç»åã¨ã®ããã£ã¨ãèããéããè¨é²ãã(Ra)ãããã¦ãããä¸ã¤ã®ã¿ã¼ã²ããç»å(B)ã«å¯¾ãã¦ãåãè¨é²ãä½æãã(Rb)ããã®ãRaã¨Rbãã»ã¼åããªããç»åAã¨Bã¯é¡ä¼¼æ§ãé«ãã ããã
重要なのは'類似'ではなく'違い'だ–まったく新しい着想に基づく高精度の画像検索アルゴリズム | TechCrunch Japan
ç»åæ¤ç´¢ã¨ã¯
ããã¹ããã¼ã¯ã¼ããç¨ããæ¹æ³ããTBIRï¼Text Based Image Retrievalï¼ã
ç»åç¹å¾´ãç¨ããæ¹æ³ããCBIRï¼Content Based Image Retrievalï¼ã¨å¼ã¶ã¿ããã ã
TBIRã¯ãç»åã«ãã¼ã¯ã¼ããç´ä»ãã¦ããã®ãã¼ã¯ã¼ãã«é¡ä¼¼ãã¦ããç»åãæ¤ç´¢ããæ¹æ³ã¨ã®ãã¨ã
ä»åã¯CBIRã«ã¤ãã¦èª¿ã¹ã¦ããããã¨æãã
å½¢ç¶ç¹å¾´ãå©ç¨ããæ¹æ³
æ¤ç´¢ãã¦ããã¨ãã¢ãã¯ãç»åæ¤ç´¢ã®ããã®å½¢ç¶ç¹å¾´ãã¨ããè«æãçºè¦ããã
SobelãCannyãã£ã«ã¿ã使ã£ã¦ã¨ãã¸ã®æ½åºããããªã£ãç»åãã3x3ã«åå²ããåé åã®ã¨ãã¸å²åãæ¯è¼ãããã¨ããæ¹æ³ã®ããã ã
æ°ã«ãªã£ãã®ãaHashï¼AverageHashï¼ã¨ããæ¹æ³ã ã
ãã®ææ³ã¯ãPerceptual Hashãã¨ããããæ¯è¼å¯è½ãªããã·ã¥ããçæããããã®ä¸ææ³ã§ãã
ä¸è¬çã«MD5ãSHA1ãªã©ã®ããã·ã¥å¤ã¯ã1ãã¤ãã§ããã¼ã¿ãéãã°ãã¾ã£ããéãããã·ã¥å¤ãè¿ãã¦ãã¾ããããPerceptual Hashãã¯ä¼¼ããããªãã¼ã¿ã«ã¯ä¼¼ããããªããã·ã¥å¤ãè¿ãã¦ãã¾ãã
簡単な画像の類似度計算手法「Average Hash」 » Untitled Blog
ã©ããªæ¹æ³ã ããã¨è¦ã¦ã¿ãã¨ãã°ã¬ã¼ã¹ã±ã¼ã«åããç»åã8x8ãã¯ã»ã«ã«ç¸®å°åããè²ã®æ¿æ·¡ã§ãããåãä½æãããã¨ãããã¨ãããã
ãAverage Hashãã¯ä»¥ä¸ã®ãããªæé ã§çæãããã¨ãã§ãã¾ãã
ç»åã®ãµã¤ãºãç¸®å° (ããã°ã«ããã°8Ã8ã«ç¸®å°)
è²ãã°ã¬ã¼ã¹ã±ã¼ã«ã«ãã
ç»åã®åãã¯ã»ã«ã使ã£ã¦è²ã®å¹³åå¤ãè¨ç®
ããããã®ãã¯ã»ã«ã§è²ã®æ¿æ·¡ã調ã¹ããã®è²ãå¹³åå¤ãããæ¿ãå ´åã¯1ããèãå ´åã¯0ãè¨å®ãã
çµæçã«8Ã8=64ãããã®ãããåãã§ãããã
pHashã¨ãããã®ãããããããDCTï¼é¢æ£ã³ãµã¤ã³å¤æï¼ã使ã£ã¦ãããããã
ãã¡ãã¯ã©ã¤ãã©ãªåãã¦ãããä¸è¨ã®ãµã¤ããããã¦ã³ãã¼ãã§ããããã©ã¤ã»ã³ã¹ã¯GPLã¨ã®ãã¨ã
pHash.org: Home of pHash, the open source perceptual hash library
libpuzzle
libpuzzleã¨ããã©ã¤ãã©ãªãæåãªããã§ã使ã£ã¦ããè¨äºããããããããããã
PHPããç°¡åã«ä½¿ããããã«ãªã£ã¦ããããããBSDã©ã¤ã»ã³ã¹ã§æ±ãããããã ã
ã©ããã¼ãä½ãã°ä»ã®è¨èªãããå©ç¨ã§ããã¨æãã
Libpuzzle - A library to find similar pictures
ããããã£ããéããã ã
ãªãããã¡ã®CoreSoloï¼å代Intel Mac miniï¼ãªç°å¢ã§ã¯ã
ã·ã°ããã£ã®çæx100ç»åã§å¤§ä½1åï½1ååã
è¿ä¼¼åº¦å¤å®x10000åã§å¤§ä½ï¼ï½ï¼ç§ã ã£ãã®ã§ã
ã·ã°ããã£ãã©ã£ãã«ä¿åãã¦ããã°ã10ä¸ç»åã®ç·å½¢æ¯è¼ããããªã許容ç¯å²ã§ã¯ãªããã¨æãããã
æ¿ãã³ã·ãã·ã丸ã®ã½ã¼ã¹ã³ã¼ãå ¬é
å
æ¥ãªãªã¼ã¹ããiPhoneã¢ããªãæ¿ãã³ã·ãã·ã丸ãã®ã½ã¼ã¹ã³ã¼ããGitHubã«ã¢ããããã
ç¹ã«ããã¢ã¤ãã¢ãæµ®ãã°ãªãã£ãã®ã§ãå¤å°ã¤ã³ãã¯ãããã£ã¦å®ç¸¾ã«ãªããããªãã®ãä½ã£ãã
ãâ¦è²ã
è¿·èµ°ããæå¥ãããåãããªãã¢ããªãå®æããã
使ãéããªãã®ã§ã½ã¼ã¹ã³ã¼ããGitHubã«ã¢ãããããã¨ã«ããã
ãã¹ãã³ã¼ããæ¸ãã¦ãªãããã¾ãããã³ã¼ãã§ã¯ãªããã©ä½ãã®åèã«ãªãã°â¦ã
Pinterestã®ãããªã¤ã³ã¿ãã§ã¼ã¹ã§ããã¤ãã¿ã¼ä¸ã«æµãã¦ãããã³åã表示ããã¢ããªã
ãã¤ãã¿ã¼ä¸ã®åç»æ
å ±ã¯ããã¤ãã¿ã¼ã®ã¹ããªã¼ã APIã使ã£ã¦ãªã¢ã«ã¿ã¤ã ã«åå¾ãã¦ããã
ã¯ã©ã¤ã¢ã³ãé¨ã¯Objective-Cããµã¼ãé¨ã¯Rails3(Unicorn + NginX) + MySQL + Redisã§åºæ¥ã¦ããã
ã¨ãããããã¯ã©ã¤ã¢ã³ãã¢ããªã ãã
pontago/objc-NicoTwi · GitHub
iOS7対å¿
é¢åãããããªã®ã§ããã°ãæ¸ãé »åº¦ãå°ãªãã£ãã®ã ãããªãã¹ãç´°ããè¨äºã§ãæ¸ããã¨ã«ããã
iOS7ããªãªã¼ã¹ãã¦ãã°ããçµã¤ã®ã ããããããã²ã¨éãiOS7対å¿ãçµãã£ãã
å¾æå¾æã®å¯¾å¿ã§ãã¢ãããã¼ããé
ããªã£ã¦ãã¾ãã¹ããã»ã³ã
ä»åã¯ã¡ã¸ã£ã¼ã¢ãããã¼ãã¨ãããã¨ãããã大å¹
ãªUIå¤æ´ãå ãã£ãã
æµè¡ã®ãã©ããUIã«å¤ãã£ããã¨ã§ãiOS6以åã¨ä¸¡æ¹ãµãã¼ãããã¢ããªã¯å°ã大å¤ãããããªãã
ã¹ãã¼ã¿ã¹ãã¼ãä¸ä½åãã
ä¸çªãã£ãããªåé¡ããã¹ãã¼ã¿ã¹ãã¼ã®ä¸ä½åã ã
ã¹ãã¼ã¿ã¹ãã¼ãã¢ããªããæä½ï¼è²ã®å¤æ´ãééã表示ã»é表示ï¼åºæ¥ãããã«ãªã£ããããUINavigationBarãªã©ã¨éåæãªãä¸ä½åããããã¨ãå¯è½ã«ãªã£ãã
ä»ã¾ã§ã¯ã¹ãã¼ã¿ã¹ãã¼ãé¤ãã座æ¨ããåå¾åºæ¥ã¦ããã®ã ããiOS7ããã¯ã¹ãã¼ã¿ã¹ãã¼ã®20pxåãå«ã¾ããªããªã£ãããã®ããã§ãã¶ã¤ã³ãå´©ãã¦ãã¾ãã¢ããªããã£ããããã¨æãã
æã£åãæ©ãã®ã¯ãUIWindowãã¹ãã¼ã¿ã¹ãã¼åãããã¦ãã¾ããã¨ã ããããããã¨ã§iOS6以åã¨åãããã«å¦çãããã¨ãã§ããã
if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f) { [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; self.window.clipsToBounds = YES; self.window.frame = CGRectMake(0, 20.0f, self.window.frame.size.width, self.window.frame.size.height - 20.0f); self.window.bounds = CGRectMake(0, 20.0f, self.window.frame.size.width, self.window.frame.size.height); }
UINavigationBarã®barTintColorãtintColorãå¤æ´ãããã¨ã§ãã¹ãã¼ã¿ã¹ãã¼ã®è²ãå¤ããã
UINavigationBarã®æ»ããå¤ãã£ã
åã®ãã¥ã¼ã«æ»ãã¨ãã®ãã¿ã³ãã<ãã¿ãããªã®ã«ãªã£ãã
ãã®ãããbackBarButtonItemãªã©ã«ã¤ã¡ã¼ã¸ä»ãã®UIBarButtonItemãè¨å®ããã¨ãã<ãåãºã¬ã¦è¡¨ç¤ºããããããªãã
åã¯æã£åãæ©ããbackBarButtonItemã§ã¯ãªããleftBarButtonItemã«è¨å®ãã¦ãã¾ã£ãã
å
·ä½çã«ã¯ãUINavigationControllerãæ´¾çããã¯ã©ã¹ãä½æããpushViewControllerããªã¼ãã¼ãã¼ãããã
ãã®ä¸ã§ãviewControllersãã«ã¦ã³ããã0以ä¸ã®å ´åï¼ä¸ã¤ä»¥ä¸ãã¥ã¼ãããã·ã¥ããã¦ããï¼ã«ãæ»ããã¿ã³ãè¨å®ãããä¾ãã°ä»¥ä¸ã®ãããªã³ã¼ãã«ãªãã
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { if ([self.viewControllers count] > 0) { viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back.png"] style:UIBarButtonItemStylePlain target:self action:@selector(popViewControllerAnimated_)]; } [super pushViewController:viewController animated:animated]; } - (void)popViewControllerAnimated_ { [self popViewControllerAnimated:YES]; }
ã«ã¹ã¿ã UIBarButtonItemã®ã¢ã¤ã³ã³è²ãåæ ãããªã
iOS7ã«ãªã£ã¦ããããã¿ã³ã«è¨å®ããç»åãtinColorï¼éè²ã¨ãï¼ã§å¡ãã¤ã¶ãããããã«ãªã£ãã
UIBarButtonItemå
ã«UIButtonãã«ã¹ã¿ã ãã¥ã¼ã¨ãã¦è¨å®ãã¦ããã®ã ããtintColorã§å¡ãã¤ã¶ãããªãã£ãã
ã©ããããUIButtonã®ç¨®é¡ããUIButtonTypeSystemã¾ãã¯ãUIButtonTypeRoundedRectã®å ´åã«ã®ã¿tinColorã§å¡ãã¤ã¶ããããããã ã
EZ-NET: iOS 7 では標準ボタンの画像が tintColor で塗りつぶされる : iPhone プログラミング
UITableViewã®ã»ã«èæ¯è²ãåæ ãããªã
UITableViewCellã®èæ¯è²ã¯ãããã©ã«ãã§ç½ï¼ã«ãªã£ãããã ã
å¤æ´ããæ¹æ³ã¯ãtableView:willDisplayCell:forRowAtIndexPath:ããtableView:cellForRowAtIndexPath:ã®ã©ã¡ãããããbackgroundColorãclearColorï¼ãããã¯å¥½ããªè²ï¼ã«å¤æ´ããã¨ããã
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundColor = [UIColor clearColor]; }
ç²ããã®ã§ãã®ã¸ãã§ã
PHPããCOMã使ã
Windowsã§IEãå¶å¾¡ããããã«COMã使ã£ã¦ã¿ãã
PHPããCOMã使ãã®ã¯ç°¡åã§ããphp.iniãããCOMãèªã¿è¾¼ãããã«è¨å®ããã°ããã¿ããã ã
PHP 5.3.15 / 5.4.5 以åã¯ãããã©ã«ãã§èªã¿è¾¼ã¾ãããããã
# php.ini [COM_DOT_NET] extension=php_com_dotnet.dll
使ãããã³ã³ãã¼ãã³ãåãå¼æ°ã«æå®ãã¦ãCOMãªãã¸ã§ã¯ããçæããã ãã§ä½¿ããã
navigateé¢æ°ã§æå®ãã¼ã¸ã«ç§»åãããã¨ã¯ãDOMãæä½ããã ãã ã
ãã¼ã¸è¡¨ç¤ºå¾ã®å¾ æ©å¦ç
navigateé¢æ°å¼ã³åºãå¾ã表示ãå®äºããã¾ã§å¾
æ©ããã®ã ãã©ãããã¤ãæ¹æ³ãããã
busyããããã£ãè¦ã¦å¤æããæ¹æ³ãä¸çªç°¡åãªããã ã
ãããããã®æ¹æ³ã ã¨DOMãæ§ç¯ãããåã«ã«ã¼ããæãã¦ãã¾ãããã
DOMè¦ç´ ã«ã¢ã¯ã»ã¹ããã¨ã¨ã©ã¼ã«ãªãå ´åãããã
while ($com_ie->busy) {
com_message_pump(3000);
}
ããä¸ã¤ã¯ãcom_event_sinké¢æ°ã§èªã¿è¾¼ã¿å®äºã®ã³ã¼ã«ããã¯é¢æ°ãæå®ããæ¹æ³ã ã
class IEEventSinker { var $completed = false; var $url = ''; function DocumentComplete(&$dom, $url) { if ($url == $this->url) { $this->completed = true; } } function OnQuit() { $this->completed = false; } } $com_ie = new COM('InternetExplorer.Application', null, CP_UTF8); $sink = new IEEventSinker(); com_event_sink($com_ie, $sink, 'DWebBrowserEvents2'); while (!$sink->completed) { com_message_pump(3000); }
ãã®æ¹æ³ã ã¨èªã¿è¾¼ã¿å®äºã®ã¤ãã³ããå¦çã§ããã®ã§å®å
¨ãããã
å®éã«è©¦ããã¨ãããå¾è
ã®æ¹æ³ã§ãã¨ã©ã¼ã«ãªããã¨ããã£ãâ¦ã
com_message_pumpé¢æ°ã使ã£ã¦ãå¦çå¾
ã¡ç¶æ
ã®ã¡ãã»ã¼ã¸ãå¦çããªããã«ã¼ããããå¼æ°ã®å¤ã¯ãã¿ã¤ã ã¢ã¦ãããªç§ã ã0ãæå®ããå ´åãå¦çå¾
ã¡ã¡ãã»ã¼ã¸ããªããã°ããã«FALSEãè¿ãã
ブラウザのビジー状態を判定するための,より良い方法 (WSHでIEを自動操作する際,COMのアプリケーションイベントを利用する) - 主に言語とシステム開発に関して
Yahooæ¤ç´¢ãèªååãã
Yahooæ¤ç´¢ã«ã¢ã¯ã»ã¹ãã¦ãã¼ã¯ã¼ããå ¥åå¾ãSubmitãããã®ãä½ã£ã¦ã¿ãã
<html>sample code. <?php class IEEventSinker { var $completed = false; var $url = ''; function DocumentComplete(&$dom, $url) { if ($url == $this->url) { $this->completed = true; } } function OnQuit() { $this->completed = false; } } $com_ie = new COM('InternetExplorer.Application', null, CP_UTF8); $com_ie->visible = true; $sink = new IEEventSinker(); com_event_sink($com_ie, $sink, 'DWebBrowserEvents2'); $sink->url = 'http://search.yahoo.co.jp/'; $com_ie->navigate($sink->url); $st = time(); while (!$sink->completed) { com_message_pump(3000); if ((time() - $st) >= 5) break; } $com_ie->document->forms(0)->p->value = 'php'; $com_ie->document->forms(0)->submit(null);
ãã©ã¼ã ã®Clickã¨Submitãåããªã
æåã¯WindowsXPä¸ã®IE7ã§è©¦ãã¦ããã®ã ãã©ãWindows8ä¸ã®IE10ã§ä¸æãåä½ããªãåé¡ãèµ·ããã
ãã©ã¼ã ã®å
¥åã¯æ£å¸¸ã«ã§ããã®ã ãã©ãClickãSubmitãåä½ããªãã
ã°ã°ãã¾ãã£ãã¨ãããä¸è¨ã®ãã¼ã¸ãçºè¦ããå¼æ°ã«NULLãæå®ããã¨ããç¡äºã«åä½ããã
ã¡ãªã¿ã«IE9以éã§èµ·ããåé¡ã¿ããã ã
Japanese user list of the Ruby programming language ()
åèã³ã¼ã
pontago/php-IECom · GitHub
ã¿ã¯ãã¹ã¤ããã使ã
温度è¨ã«ã¢ã¼ãåãæ¿ãï¼æé«æ¸©åº¦ãæä½æ¸©åº¦ï¼ãä»ãããã£ãã®ã§ãã¿ã¯ãã¹ã¤ããã®ä½¿ãæ¹ã調ã¹ããã¨ã«ããã
ã¾ãã¯ããã¤ã³ã³ã使ããã«ã¿ã¯ãã¹ã¤ããã使ã£ã¦ãLEDãç¹ç¯ã»æ¶ç¯ãããã
ããªãè¦æ¦ããã®ã ãã©ããããããªäººã«æãã¦ããã£ã¦ä½ã¨ãå®æããããã¨ãã§ããã
ã¿ã¯ãã¹ã¤ããã®æ§é
ã¿ã¯ãã¹ã¤ããã¯æ¼ãã¨ã«ããã¨æå¿ãã®ããæ¼ããã¿ã³ã ãæ¼ãã¦ããéã ãé»æµãæµãããããã
足ã¯4æ¬ä»ãã¦ãã¦ãæ¼ããã¨ã§2æ¬ã®è¶³ãæ¥ç¶ããé»æµãæµããã¨ãããåç´ãªä»çµã¿ã®ããã ã
ä¸è¨ã®ãã¼ã¸ãåèã«ããã¦ããã£ãã
arduino使い方:スイッチの入/切でLEDを点灯
ã¿ã¯ãã¹ã¤ããã使ã£ã¦LEDãæä½
æ¼ãã¦ããéã ãLEDãç¹ç¯ãããåè·¯ãä½ã£ã¦ã¿ããã¨ã«ããã
åè·¯ã¯ä¸è¨ã®ãã¼ã¸ãåèã«çµãã§ã¿ãã
ãã¤ã³ã³ã使ã£ã¦ã¿ã¯ãã¹ã¤ãããæä½
ç¶ãã¦ããã¤ã³ã³ã使ã£ã¦LEDãç¹ç¯ããã¦ã¿ããã¨ã«ããã
PD3ã«LEDãæ¥ç¶ãPD4ã«ã¿ã¯ãã¹ã¤ããã®ã¢ãã¼ããæ¥ç¶ããã
PD4ã¯å
¥åã«ãªããããDDRDã¬ã¸ã¹ã¿ã§ããã4ã0ã«ããPD3ã¯åºåã§ä½¿ããããããã3ã1ã«ããã
ã¾ããå
é¨ãã«ã¢ãããæå¹ã«ããããã«ãPORTDã¬ã¸ã¹ã¿ã®ããã3ã1ã«ããå¿
è¦ãããã
ããã¯ãã¹ã¤ãããã©ãã«ãæ¥ç¶ããã¦ããªãå ´åãé»å§ãä¸å®å®ã«ãªã0ãªã®ã1ãªã®ãåãããªããªã£ã¦ãã¾ãããã ã
ãããé²ãããã«ã¹ã¤ããã¨ã®éã«æµæãã¯ããå¿
è¦ããããããããã«ã¢ããæµæã¨ããã
AVRã®å ´åããã«ã¢ããæµæãå
èµãã¦ããã®ã§ãä¸è¨ã®ããã«PORTDã¬ã¸ã¹ã¿ã®ããããç«ã¦ãã¨ãå
é¨ãã«ã¢ããæµæãæå¹ã«ãªãã
ãã¨ã¯ãbit_is_clearé¢æ°ã§PD4ã0ã«ãªã£ã¦ããããã§ãã¯ããLEDã®ç¹ç¯ãããã ãã ã
bit_is_clearé¢æ°ã¯ã第ä¸å¼æ°ã«ãã§ãã¯ããã¬ã¸ã¹ã¿ï¼PORTBãPORTDï¼ã第äºå¼æ°ã«ãã§ãã¯ãããããçªå·ãæå®ããã
0ã«ãªã£ã¦ããã¨trueãè¿ã£ã¦ãããåæ§ã«bit_is_seté¢æ°ã¯ã1ã«ãªã£ã¦ããã¨trueãè¿ã£ã¦ããããã ã
ãã®é¢æ°ã使ãã°ãç°¡æ½ã«è¨è¿°ãããã¨ãã§ããã
ãã®åè·¯ã¯ãã®ãã®ãºããªã®ãã®ããä¸è¨ãã¼ã¸ã«æ¸ãã¦ãã£ãã®ã§åèã«ããã¦ããã£ãã
LED点灯 ( IO入出力 )
top
é·æ¼ããå¤å®ãã
ã¹ã¤ããã®ãªã³ã»ãªãã®ä»ã«ãé·æ¼ããå®è£
ãã¦ã¿ããã¨ã«ããã
ã¢ã¼ãåãæ¿ãã¯ã¹ã¤ããã®çæ¼ãã使ã£ã¦ãæé«æ¸©åº¦ãæä½æ¸©åº¦ã¯é·æ¼ãã§ãªã»ããåºæ¥ãããã«ããããã ã
é·æ¼ããå¤å®ããããã«ã¿ã¤ãå²ãè¾¼ã¿ã使ããã¨ã«ãããããããã¨ã¦ããããããé·ãéã®ãã¨ãªã£ãâ¦ã
çæ¼ãã¨ãé·æ¼ããå¤æããã®ããããªã«ãããããã¨ã¯æããªãã£ãã
æ®æ®µä½æ°ãªã使ããã¨ãå¤ãã®ã ãã©ãåç´ãªä»çµã¿ã§ãä¸ããä½ãã¨ãªãã¨ãããããããã ã
åè·¯å³ã¯ä¸è¨ã®ããã«ãªã£ãã
ã¿ã¤ãå²ãè¾¼ã¿ã使ã
ã¿ã¤ãå²ãè¾¼ã¿ã«ã¤ãã¦ã¯èª¬æãã¦ãããµã¤ããããããããã®ã§å²æããã
ä¸è¨ã®ãµã¤ãã詳ãã説æããã¦ãã¦åèã«ãªã£ãã
http://d.hatena.ne.jp/hijouguchi/20100620/1276997802
ç°¡åã«èª¬æããã¨ãã«ã¦ã³ã¿ç¨ã¬ã¸ã¹ã¿ï¼TCNT0ï¼ããã£ã¦ãä¸å®å¨ææ¯ã«ãã®ã¬ã¸ã¹ã¿ã®å¤ãã«ã¦ã³ãã¢ããããã¦ããã
ã¬ã¸ã¹ã¿ããªã¼ãã¼ããã¼ããããè¨å®ããå¤ã«å°éããã¨å²ãè¾¼ã¿ãã³ãã©ãå¼ã³åºãããã¨ãããã®ã ã
大äºãªã®ã¯ãã¯ããã¯æ°ã¨åå¨æ¯ããä½ç§ãã¨ã«å²ãè¾¼ã¿ãã³ãã©ãå¼ã³åºãããã®ããèãããã¨ã ã¨æãã
ä»åã¯ãATTINY2313ã8MHzã§åããã¦ãã¦ãåå¨æ¯ã1024ã«è¨å®ãããï¼ä»ã«ã256ã8ãªã©è¨å®ã§ããï¼
åå¨æ¯ã¯ããTCCR0Bãã¬ã¸ã¹ã¿ã§è¨å®ãããåå¨æ¯1024ãªã®ã§ã0b00000101ã¨ãªã£ãã
8000000(8MHz) / 1024(åå¨æ¯) = 7812.5Hz
ã¨ãªãã®ã§ã1ç§éã«7812ååä½ããã¨ããã¨ã ã
1(ç§) / 7812(Hz) = ç´0.000128ç§ = 0.128msï¼ããªç§ï¼
0.128msæ¯ã«ã«ã¦ã³ãã¢ããããã¦ãããã¨ã«ãªãã
ä»åã¯ã«ã¦ã³ã¿ç¨ã¬ã¸ã¹ã¿ããªã¼ãã¼ããã¼ããã¨ãã«å²ãè¾¼ã¿ãã³ãã©ãå¼ã³åºãããã«ããã
ã«ã¦ã³ã¿ç¨ã¬ã¸ã¹ã¿ã¯8ããããªã®ã§ã256ã«ãªãã¨ãªã¼ãã¼ããã¼ãããã¨ã«ãªãã
0.128(ms) * 256 = 32.768ms
ç´32msæ¯ã«å²ãè¾¼ã¿ãã³ãã©ãå¼ã³åºãããããã ã
ã¿ã¤ãå²ãè¾¼ã¿ã®å®è¡
ã¿ã¤ãå²ãè¾¼ã¿ã使ãããã«ã¯ããinterrupt.hããã¤ã³ã¯ã«ã¼ãããã
TCCR0Bã¬ã¸ã¹ã¿ãTIMSKã¬ã¸ã¹ã¿ãè¨å®ããå¾ãseié¢æ°ãå¼ã³åºããã¨ã§å®è¡ãããã
seié¢æ°ã¯ãå
¨å²ãè¾¼ã¿ãæå¹ã«ãããé¢æ°ã ãéã«ceié¢æ°ã¯ãå
¨å²ãè¾¼ã¿ãç¡å¹ã«ãããé¢æ°ã«ãªãã
å²ãè¾¼ã¿ãã³ãã©ã¯ãISRãã¯ãã使ã£ã¦è¨å®ããã
æåISRã¯é¢æ°ã ã¨æã£ãã®ã ãã©ãããããè¦ã¦ã¿ãã¨ãã¯ãã«ãªã£ã¦ããã
第ä¸å¼æ°ã«ä½¿ããã³ãã©åãå
¥ããã
ä»åã¯ãTIMER0ã®ãªã¼ãã¼ããã¼ã¨ãããã¨ã§ä»¥ä¸ã®ããã«ãªã£ãã
ISR(TIMER0_OVF_vect) { }
é·æ¼ããã©ã®ããã«å¤æããã
çæ¼ãã¨é·æ¼ããåºå¥ãããã®ã«è¦å´ããã
32msæ¯ã«ã¹ã¤ãããæ¼ããã¦ãããå¤æãã3ç§ä»¥ä¸æ¼ããã¦ãå ´åã«ãé·æ¼ãã¨å¤æããããã¨ã«ããã
3ç§æªæºã§ã¹ã¤ãããé¢ããå ´åã¯ãçæ¼ãã¨ãªãããã«ããã
æ¼ããå ´åã«å¤å®ããã¦ãã¾ãã¨ãçæ¼ãã¨é·æ¼ãã®ã¤ãã³ããåæã«èµ·ãã¦ãã¾ããåä½ããããããªã£ã¦ãã¾ãã
ãªã®ã§ãé·æ¼ãã¨åºå¥ãããããã«ãçæ¼ãã®å ´åããªãªã¼ã¹æï¼ã¹ã¤ãããé¢ããæï¼ã«å¤å®ããããã¨ã§ä¸æããã£ãã
ã¾ããé·æ¼ãããã¦ããæéã調ã¹ãããã«å¤æ°ã«ãã³ãã©å¼ã³åºãããåæ°ãä¿åãããã¨ã«ããã®ã ãã©ããã£ã¨é·æ¼ããã¦ããã¨ã«ã¦ã³ã¿å¤æ°ããªã¼ãã¼ããã¼ãã¦ãã¾ã誤åä½ããã¨ãããã¨ããã£ãã
ã«ã¦ã³ã¿å¤æ°ã大ãããã®ãã¦ä¸æãã®ããããã¨ãåºæ¥ãã®ã ãã©ãä»åã¯ãé·æ¼ãå¤å®æéã®3ç§ãè¶ããå ´åãã«ã¦ã³ãã¢ãããããªãããã¨ã§å¯¾å¿ããã
ä»åã®ã³ã¼ããGitHubã«ã¢ããããã
pontago/avr-TactSwitchTest · GitHub
åèãµã¤ã
[AVRexample] Timer0 オーバーフロー | 花夢電科雑多猫
無機物の週末 超☆ゆとり的電子工作 その2!
http://d.hatena.ne.jp/hijouguchi/20100620/1276997802
http://www.hokutodenshi.co.jp/PUPPYSupportPage/ensyu/timer/timer2.html
AVR timer(1) | stastaka's Blog
タイマ/カウンタ1を使う
[example] 外部割り込み - 花夢電科雑多猫 マニュアル&メモ
つくろぐ 技術系
ãã©ã³ã¸ã¹ã¿ã¢ã¬ã¤ã使ã
ãã©ã³ã¸ã¹ã¿ãæµæã®æ°ãæ¸ããããã«ãã©ã³ã¸ã¹ã¿ã¢ã¬ã¤ã使ããã¨ã«ããã
ãã©ã³ã¸ã¹ã¿ã¢ã¬ã¤ã¯ãTD62064APGã¨ããNPNåã®4chã®ãã®ã使ç¨ããã
7ã»ã°3æ¡ã®ãã©ã³ã¸ã¹ã¿ã»æµæãç½®ãæãã
7ã»ã°ã§ä½¿ã£ã¦ãããã©ã³ã¸ã¹ã¿ã¨æµæãç½®ãæãããã¨ã«ããã
7ã»ã°ä¸ã¤ã«å¯¾ãã¦ããã©ã³ã¸ã¹ã¿1ã¤ã¨æµæãäºã¤æ¸ããã¨ã«ãªãã®ã§ãã ãã¶ã¹ãããªããã¯ãã ã
4chãªã®ã§ãO1~4ãI1ã4ãåã»ãããããä¸å¤®ã«GNDãããã¦COMï¼ã³ã¢ã³ï¼ãäºã¤ããã
Oã¯ã¢ã¦ãããããIã¯ã¤ã³ãããã¨ãããã¨ãããã
I1ã4ã«ãã¤ã³ã³ãO1ã4ã¯7ã»ã°ã®ã³ã¢ã³ã¨æ¥ç¶ããã
COMã«ã¯ããã©ã³ã¸ã¹ã¿ãä¿è·ããããã®ãã¤ãªã¼ããä»ãã¦ãã¦ããããããªã¼ãã¤ã«ãã¤ãªã¼ãã¨ãããããã
èªå°æ§ã³ã¤ã«è² è·ï¼ã¢ã¼ã¿ãã½ã¬ãã¤ãããªã¬ã¼çï¼ã使ããªããã°ãç¹ã«æ¥ç¶ããå¿
è¦ã¯ãªãããã ã
ãã¼ã¹æµæãªã©ãä»ãã¦ããã®ã§ãè¨ç®ãªã©ã¯å¿ è¦ãªãããã®ã¾ã¾ç½®ãæããã°ããã ããªã®ã§ç°¡åã ã£ãã
åè·¯å³ãæ¸ãã¦ã¿ã
ãã¾ãã«ããã£ããçµãã£ã¦ãã¾ã£ãã®ã§ãåè·¯å³ãæ¸ãã¦ã¿ããã¨ã«ããã
æåã¯ããã¼ã½ããã§é©å½ã«æ¸ãã¦ã¿ãã®ã ãã©ãåè·¯å³ãæãã®ãæå¤ã¨æ¥½ããã£ãã®ã§ãå°ç¨ãã¼ã«ã使ã£ã¦æ¸ãç´ããã
OSXã§ã使ããåè·¯å³ä½æãã¼ã«ãæ¢ãã¦ã¿ãã¨ãBSchV3ã¨ããã®ãè¦ã¤ãããå¤ããããããã¼ã«ã§æåãããã
åè·¯å³ã®èªã¿æ¹ã調ã¹ã¤ã¤é©å½ã«æãã¦ã¿ããåã£ã¦ãããªï¼
åè
電子部品使い方:マイコン出力のスイッチ(トランジスタ2)
トランジスタアレイ「TD62083AP」のホントの使い方
初歩のPIC【18】デジタルは5Vであらず・出力編
Qt-BSch3V の使い方 - ルギア君の戯言
USBã·ãªã¢ã«å¤æã¢ã¸ã¥ã¼ã«ã使ã
ã¾ãããé»åå·¥ä½ããµãã£ã¦ãã¾ã£ãâ¦ã
ãã©ã¤ãã¼ããããã°ã©ãã³ã°ãããªããªãã£ã¦ã人ã¯ãããã¨æãã
ãã®éãã¤ã³ã³å
çããé»åå·¥ä½ç¨ã®é¨åãè²ã
ããã ããã
ã¸ã£ã³ãã¼ç·ãLCDãªã©ä¾¿å©ãªãã®ã°ããâ¦æè¬æè¬ã
ã©ãããåå¹´ããããç¡æ²æ±°ã ã£ãã¿ããã ã
ä»åããã£ãã·ãªã¢ã«å¤æã¢ã¸ã¥ã¼ã«ãªã©ã®é¨åã¯ãå®ã¯æ£æã«è²·ã£ã¦ãããã
ã±ã¼ã¹ããåºç¤ãªã©ãè²·ãè¾¼ãã ã®ã§ãæ©ãã¨ãã温度è¨ãå®æããã¦ãããã®ã ãã©ããªãããªãå
¼ãã¦ã·ãªã¢ã«éä¿¡ããã£ã¦ã¿ããã¨ã«ããã
USBã·ãªã¢ã«å¤æã¢ã¸ã¥ã¼ã«ããã¤ã³ã³ã«æ¥ç¶
è³¼å
¥ããã·ãªã¢ã«å¤æã¢ã¸ã¥ã¼ã«ã¯ãç§æé»åã§å£²ã£ã¦ãããã®ã§ãFT232RLã¨ããUSB-ã·ãªã¢ã«å¤æç¨ã®ICãåºç¤ã«ãã£ã¤ãããã®ã ã
æ¥ç¶ã¯ç°¡åã§ããã¹ãã¯ã¼ã§USBããé»æºã確ä¿ã§ããã®ã§ãGNDãTXDã¨RXDããã¤ã³ã³ã¨æ¥ç¶ããã ãã§å¤§ä¸å¤«ãããã
ãã¤ã³ã³ã¯ATTINY2313ã使ç¨ããã
TXDã¨RXD
å¤æã¢ã¸ã¥ã¼ã«ã«ä»å±ããã¦ãã説ææ¸ã«ãè¨è¼ããã¦ããã®ã ãã©ãTXDã¯ãéä¿¡ãã¼ã¿åºåããRXDãéä¿¡ãã¼ã¿å
¥åãã¨ãããã¨ãããã
ããããã¤ã³ã³å´ã®TXDã¨RXDã«ã¯ãã¹ãã¦æ¥ç¶ãããæåã«ã¯ãã¹ã§æ¥ç¶ãããã¨ã«æ°ã¥ããç¦ã£ãã
è¦ã¯ãå¤æã¢ã¸ã¥ã¼ã«ã®TXDããã¤ã³ã³ã®RXDã«ãå¤æã¢ã¸ã¥ã¼ã«ã®RXDããã¤ã³ã³ã®TXDã«æ¥ç¶ããã
å¤æã¢ã¸ã¥ã¼ã«ã¨PCãæ¥ç¶
ãã©ã¤ããå¿
è¦ãªããã ã£ãã®ã§ãä¸è¨ã®ãµã¤ããããã¦ã³ãã¼ããããMacBookAirã使ã£ã¦ããã®ã§ãOSXçãã¤ã³ã¹ãã¼ã«ããã
Virtual COM Port Drivers
screenã§ã·ãªã¢ã«éä¿¡ãåºæ¥ãããã ã£ãã®ã ãã©ãä»ã«ä½¿ãããããã®ããªããæ¢ããã¨ãããCoolTermã¨ããã¢ããªãçºè¦ãããã¨ãããããããã¤ã§è¡ããã¨ã«ããã
Roger Meier's Freeware
USARTï¼UARTï¼
詳ãã説æã¯ã°ã°ãã°åºã¦ããã®ã§ãã£ãã説æããã¨ã
1æ¬ã®ä¿¡å·ç·ä¸ã®ä¿¡å·ããããã³ã«ã«å¾ãã1ããã0ãã§ãã¼ã¿ãéãéä¿¡æ¹æ³ã
å
¨äºéã®éåæéä¿¡ãåäºéã®åæéä¿¡ã®äºéããããããã ã
ãã¼ã¬ã¼ã
å¤å¾©èª¿é度ã®ãã¨ã§ãã¤ã³ã³ã®ã¯ããã¯æ°ã«ãã£ã¦è¨å®ããå¤ãå¤ããããã¤ã³ã³ã®ãã¼ã¿ã·ã¼ãã«ä¸è¦§ãè¼ã£ã¦ããã®ã§ãã¯ããã¯æ°ã¨éä¿¡é度ããé©åãªãã®ãé¸ã¹ã°ããã
ä¸è¬çãªéä¿¡é度9600bpsã§éä¿¡ãããã¨ã«ããã
ãã¤ã³ã³ã®ã¯ããã¯æ°ã¯8MHzãªã®ã§ãè¨å®ãããã¼ã¬ã¼ãã¯51ã¨ãªã£ãã
ã·ãªã¢ã«éä¿¡ãã¦ã¿ã
ãã使ããã¦ããè¨å®ã§ã·ãªã¢ã«éä¿¡ããããªããã¨ã«ããã
è¨å®å
容ã¯ãéåæéä¿¡ãããªãã£ç¦æ¢ãåæ¢ããã1bitããã¼ã¿ãããé·8ãããã
ã¾ãã¯åæåå¦çã®ã³ã¼ãã¯ä¸è¨ã®ããã«ããã
UBRRL = 51; // 9600bps UCSRB= (1 << RXEN) | (1 << TXEN); UCSRC = (1 << UCSZ1) | (1 << UCSZ0);
UBRRLã¬ã¸ã¹ã¿ã«ãã¼ã¬ã¼ãå¤ãå
¥ããã
UCSRBã¬ã¸ã¹ã¿ã§ãRXENã¨TXENã®ããããç«ã¦ããRXENããå信許å¯ããTXENããé信許å¯ãã«ãªãã
UCSRCã¬ã¸ã¹ã¿ã¯ãUCSZ1ã¨UCSZ0ãããã¼ã¿ãããé·ãã«ãªãã
8ãããã®å ´åã¯ãã011ãã«ãªãã®ã§ãUCSZ1ã¨UCSZ0ã®ä¸¡æ¹ã®ããããç«ã¦ãã°OKã ã
æ¬å½ã¯ãUCSZ2ãããã®ã ãã©ãããã¯UCSRBã¬ã¸ã¹ã¿ã®ã»ãã«å
¥ã£ã¦ããâ¦ç´ãããããä»åã¯8ããããªã®ã§ç¹ã«è¨å®ããå¿
è¦ã¯ãªãã
ã³ã¼ãã¯ãã°ã°ãã°ããããåºã¦ãããããã¼ã¿ã·ã¼ãã«ãæ¸ãã¦ããã®ã§ç¹ã«è¿·ããã¨ã¯ãªãã£ãã
ã¨ãããããã·ãªã¢ã«éä¿¡ã®éåä¿¡ãå®è£
ããã¿ã¼ããã«ããéä¿¡ããæååããã®ã¾ã¾ã¨ã³ã¼ããã¯ãããã³ã¼ããæ¸ãã¦ã¿ãã
ã³ã¼ãã¯ãã¡ã
pontago/avr-SirialTest · GitHub