4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Annikken AndeeでテープLEDを制御してみる

Posted at

Annikken Andee-An Easy Link between Arduino and Android. | Indiegogo のブツが届いたので試してみた。

IMG_20130823_143013.jpg

とりあえず手元にあったフルカラーのテープLEDの操作を試してみることにした。

テープLEDはakibaLED ピカリ館で購入したフルカラータイプのもの。ついでに点灯テスト用にコントローラーも購入。秋月で売ってるものと同じタイプだと思われる。

IMG_20130823_143715.jpg

はじめはフルカラーLEDコントローラ(赤外リモコン式)およびフルカラーLEDテープ(3-1/3) (キットと初歩の電子工作 Kits and Kids)を参考にテストしてた。

IMG_20130823_143626.jpg

これでも良かったけど、コントローラーが赤外線リモコン対応だったので赤外線LEDでコントロールしてみることにした。

リモコンのライブラリはGrove SystemのIRSendRevを使った。

IMG_20130823_144020.jpg

andee.png

ボタンの反応が若干遅いのが気になるが、簡単に使えるところは気に入った。

# include <IRSendRev.h>
# include <SPI.h>
# include <Andee.h>
# include <time.h> //to use delay function

AndeeHelper andeeHelper[6]; //Declare 6 instance of AndeeHelper.
unsigned char d[][10] = {
  {9,	178,	89,	11,	32,	4,	0,	255,	176,	79	},
  {9,	178,	88,	10,	32,	4,	0,	255,	248,	7	},
  {9,	179,	88,	11,	32,	4,	0,	255,	152,	103	},
  {9,	177,	88,	11,	32,	4,	0,	255,	216,	39	},
  {9,	177,	88,	11,	32,	4,	0,	255,	136,	119	},
  {9,	177,	88,	11,	32,	4,	0,	255,	168,	87	}
};

void setup(){
  Andee.begin();  //Setup communications between Annikken Andee and Arduino 
  setInitialData();
  Andee.clear();//Clear the screen of any previous displays
}

void setInitialData(){
  andeeHelper[0].setId(0);
  andeeHelper[0].setType(BUTTON_IN);
  andeeHelper[0].setLocation(0,0,HALF);
  andeeHelper[0].setTitle("ON");
  andeeHelper[1].setId(1);
  andeeHelper[1].setType(BUTTON_IN);
  andeeHelper[1].setLocation(0,1,HALF);
  andeeHelper[1].setTitle("OFF");
  
  andeeHelper[2].setId(2);
  andeeHelper[2].setType(BUTTON_IN);
  andeeHelper[2].setLocation(1,0,ONE_QUART);
  andeeHelper[2].setTitle("R");
  andeeHelper[2].setColor(RED);
  andeeHelper[3].setId(3);
  andeeHelper[3].setType(BUTTON_IN);
  andeeHelper[3].setLocation(1,1,ONE_QUART);
  andeeHelper[3].setTitle("G");
  andeeHelper[3].setColor(GREEN);
  andeeHelper[4].setId(4);
  andeeHelper[4].setType(BUTTON_IN);
  andeeHelper[4].setLocation(1,2,ONE_QUART);
  andeeHelper[4].setTitle("B");
  andeeHelper[4].setColor(BLUE);
  andeeHelper[5].setId(5);
  andeeHelper[5].setType(BUTTON_IN);
  andeeHelper[5].setLocation(1,3,ONE_QUART);
  andeeHelper[5].setTitle("W");
  andeeHelper[5].setColor(GRAY);
}
void loop(){
  int i;

  // Tell Andee to display data
  for(i=0; i<6; i++){
    andeeHelper[i].update();
    if (andeeHelper[i].isPressed()) {
      IR.Send(d[i], 38);
      andeeHelper[i].ack();
    }
  }
  
  //Delay for 1 second, here we send update every second.
  delay(1000);
}
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?