メインコンテンツへスキップ

テストコード

/*
 * Lチカ  Arduion
 *
 *
 * このスケッチは。Arduinoの基本テスト用
 *
 * 動作確認済みボード一覧
 *    https://en.wikipedia.org/wiki/List_of_Arduino_boards_and_compatible_systems
 *   
 *    Arduion UNO R3        __AVR_ATmega328P__
 *    EPS8266
 *
 *
 */

#include <Arduino.h>
#if defined(__AVR_ATmega328P__)
#else
#include <ESP8266WiFi.h>
#endif

/*
 *    アプリケーション情報
 */
#define appName     "LED Chika"
#define appDates    "2016-05-08 19:19"
#define appInitMsg  "A10 Objs.,Inc."
void printAppInfo () {
  Serial.println("");
  Serial.println("");
  Serial.print(" [[ ");
  Serial.print(appName);
  Serial.print(" ");
  Serial.print(appDates);
  Serial.print(" ");
  Serial.print(appInitMsg);
  Serial.println(" ]]");
  Serial.println("");
}

/*
 * 各種定義
 */
//  PIN 定義
#if defined(__AVR_ATmega328P__)
const int PORT_LED        = 13;
#else
const int PORT_LED        = 13;
#endif

//  通信 定義
volatile static long serialPortSpeeds = 115200;     //  PCのシリアルポートのスピード   921600 or 115200 or 74880
//  LED 点滅スピード
volatile static long LEDflashingSpeed = 100;        //  ms

/*
 * 初期化
 */
void setup() {
  // put your setup code here, to run once:
  Serial.begin(serialPortSpeeds);
  printAppInfo();
 
  Serial.println("------ setup() start ------");

  Serial.println("print test 01");
  Serial.println("print test 02");
  Serial.println("print test 03");
  Serial.println("print test 04");
  Serial.println("print test 05");
  Serial.println("print test 06");
  Serial.println("print test 07");
  Serial.println("print test 08");
  Serial.println("print test 09");
  Serial.println("print test 10");


  pinMode(PORT_LED,OUTPUT);

  Serial.println("------ setup() end  ------");
}

/*
 * メインループ
 */
void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(PORT_LED,HIGH);
  delay(LEDflashingSpeed);
  digitalWrite(PORT_LED,LOW);
  delay(LEDflashingSpeed);

}