Page 479 - MDP2020-1
P. 479
················································································ 명장양성프로젝트 【MDP】 과제발표회 자료집 Ⅰ | 473
<WizFi250 EVB + Aduino Mega 2560>
[사용한 컴파일러 : 아두이노 IDE / 사용한 언어 : C]
1) 라즈베리 파이 서버와 통신 및 본 시스템 메인보드 연결용 와이파이 모듈
/* 와이파이 모듈을 통해 STM보드, 라즈베리파이 서버, 안드로이드 스튜디오 및
파이어베이스와의 상호 통신을 진행 중인 프로그램이며, 전송속도 및 키 설정을 통해 Rx, Tx를
설정하는 프로그램 입니다.
*/
#include <Arduino.h>
#include <SPI.h> // Serial Peripheral
interface 설정
#include <IPAddress.h>
#include <WizFi250.h> // WizFi250 와이파이
모듈을 사용
#include <WizFi250_tcp_server.h>
#define SSID "BrightLight" // 고유 식별자 설정 (밝은 조명)
#define KEY "20200906" // 키 값 부여
#define AUTH ""
#define LOCAL_PORT 8080 // 포트 설정
boolean Wifi_setup = false;
boolean currentLineIsBlank = false;
boolean IsSendHtmlResponse = false;
WizFi250 wizfi250;
uint8_t currentLineIsBlankCnt = 0;
WizFi250_TCP_Server myServer(LOCAL_PORT);
void sendData(); // 데이터 송신 함수
// The setup function is called once at startup of the sketch
void setup() // 기본 설정 함수
{
// Add your initialization code here
Serial.begin(9600); // Baud rate 설정
Serial.println("\r\nSerial Init");
wizfi250.begin();
wizfi250.setDebugPrint(4);