Arduinoを速くするワザ

F072Oofg145Rves.Medium

上級者向けの素晴らしいInstructableだ。コードはポータブルではなくなるけど、上級者なんだから、そこはなんとかなるでしょ。:) RazorConceptsの解説より

Arduinoは遅いって? なんだ? このInstructibleは、Arduinoの遅い部分を指摘して、その改善策を示している。たしかに、Arduinoには遅いところがある。なかでもdigitalWriteコマンドはかなり遅い。LEDを1回だけ点灯させるスイッチ回路などでは気がつかないかもしれないが、TLC5947 PWMを使おうとしたときは実感した。これは、Arduinoに毎回288バイトのシフトを要求する。各バイトは約12回のdigitalWriteを要求するため、TLC5947に新しいデータをシフトインするごとに、総計で3456回のdigitalWritesが行われることになる。どのくらい時間がかかるか? digitalWriteだけで30秒だ! しかし、これには解決策がある。"true c"スタイルのコマンドを使うのだ。AVR GCC(GNU C コンパイラー)が使ってるものだ。Arduinoの頭脳にはATMega168sまたはATMega328sが使われている。AVRコミュニティーでは、通常、これらのCプログラムには"true c"コマンドを使っているからだ

- Phillip Torrone

原文

Posted by Tetsuo Kanai | Nov 5, 2009 01:00 AM
Instructables | Permalink | Comments (0)

Recent Entries

Leave a comment



Bloggers

Welcome to the Make:Japan Blog. You'll find all the most up to date happenings in the Maker and Crafts world here.

Tetsuo KanaiTetsuo Kanai
Translator/Writer


Takumi Funada.Takumi Funada
Engineer


Hideo TamuraHideo Tamura
Editor


MAKE Japan.

Advertise here with FM.

Why advertise on MAKE?
Read what folks are saying about us!

Click here to advertise on MAKE!

Purchase MAKE.

Categories

Archives

Recent Posts