テストプログラム (Arduino)
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <Ticker.h>
#define appDates "2016-04-17 01:39"
#define appInitMsg "A10 Objs.,Inc."
volatile static int serialPortSpeeds = 115200; // PCのシリアルポートのスピード 921600 or 115200
volatile static bool serialPortOutput = true; // PCのシリアルポート出力設定 false:off, true:ON
// PIN 定義
const int PORT13_LED = 13;
// 変数 定義
Ticker ledTicker;
void setup() {
// put your setup code here, to run once:
setupLEDBlink();
/*
* WiFi.mode(m): set mode to WIFI_AP, WIFI_STA, WIFI_AP_STA or WIFI_OFF.
*/
WiFi.mode(WIFI_AP); //
}
void loop() {
// put your main code here, to run repeatedly:
}
// ********* LED Blink 関連 ******************************************
void setupLEDBlink() {
pinMode(PORT13_LED,OUTPUT);
digitalWrite(PORT13_LED,HIGH);
ledTicker.attach(0.1, blinkLED); // 割り込み設定 & 処理開始
}
void blinkLED() {
if(serialPortOutput) Serial.println("ledTicker: blinkLED");
int nextPinValue = LOW;
nextPinValue = (digitalRead(PORT13_LED) == HIGH)? LOW: HIGH;
digitalWrite(PORT13_LED,nextPinValue);
}