[IFB][ENC28J60]

- IFB v2.0 : JLCPCB 주문의 건
- ENC28J60 사용 test code
devIFB_v2
Changwoo Park 1 year ago
parent acfcf8e030
commit 2789e42c77

@ -6,6 +6,8 @@
/* ---------- Periodics ---------- */ /* ---------- Periodics ---------- */
// Flags // Flags
bool T_1ms = false; bool T_1ms = false;
bool T_2ms = false;
bool T_5ms = false;
bool T_10ms = false; bool T_10ms = false;
bool T_20ms = false; bool T_20ms = false;
bool T_50ms = false; bool T_50ms = false;
@ -19,7 +21,8 @@ bool T_5000ms = false;
// Datas // Datas
int msCnt = 0; int msCnt = 0;
unsigned long timer = 0; unsigned long timer = 0;
#define AI_AVG_SIZE 20 #define AI_AVG_SIZE 50
#define AI_RANGE 8
/* ---------- Arduino Mega 2560 Basic IO ---------- */ /* ---------- Arduino Mega 2560 Basic IO ---------- */
// Pins // Pins
@ -32,11 +35,12 @@ const int AiPin[] = { A0, A1, A2, A3, A4, A5, A6, A7,
// Data Storages // Data Storages
int Size_DO = 16; int Size_DO = 16;
int Size_DI = 8; int Size_DI = 8;
int Size_AI = 16; int Size_AI = AI_RANGE;
int index_AI = 0;
int Values_DI; // digit values to a number int Values_DI; // digit values to a number
int Values_AI[16]; int Values_AI[AI_RANGE];
int Recent_AI[16][AI_AVG_SIZE]; int Recent_AI[AI_RANGE][AI_AVG_SIZE];
/* ---------- I2C (Analog Output, DAC) ---------- */ /* ---------- I2C (Analog Output, DAC) ---------- */
// Addresses // Addresses

@ -1,8 +1,6 @@
#include "FC_InterfaceBoard.h" #include "FC_InterfaceBoard.h"
#define CR "\r" #define CR "\r"
#define FIN "\n" #define FIN "\n"
#define CRLF "\r\n" #define CRLF "\r\n"
@ -13,7 +11,7 @@
String IdeSerial; // for 485_0 String IdeSerial; // for 485_0
void setup() { void setup() {
// put your setup code here, to run once: // Serial setup (Debug)
Serial.begin(9600); Serial.begin(9600);
Serial.println("Start!"); Serial.println("Start!");
@ -98,13 +96,16 @@ void loop() {
} }
// Init // Init
else if(cmd=="State?"){ else if(cmd=="State?"){
client.print(cmd + " " + RcvOK + FIN);
}else if(cmd=="RngAO!"){ }else if(cmd=="RngAO!"){
dataSize = demuxNum(cmdData, data); dataSize = demuxNum(cmdData, data);
client.print(Prcss_RngAO(data, dataSize)); client.print(Prcss_RngAO(data, dataSize));
}else if(cmd=="ChMC9_1!"){ }else if(cmd=="ChMC9_1!"){
dataSize = demuxNum(cmdData, data); dataSize = demuxNum(cmdData, data);
client.print(Prcss_ChMC9(data, dataSize)); client.print(Prcss_ChMC9(data, dataSize));
} }
// Extra // Extra

@ -15,11 +15,17 @@ void read_analog(){
for(i = 0 ; i < Size_AI ; i++){ for(i = 0 ; i < Size_AI ; i++){
Values_AI[i] = analogRead(AiPin[i]); Values_AI[i] = analogRead(AiPin[i]);
/*
for(int j = 0; j < AI_AVG_SIZE - 1; j++) { for(int j = 0; j < AI_AVG_SIZE - 1; j++) {
Recent_AI[i][j] = Recent_AI[i][j + 1]; Recent_AI[i][j] = Recent_AI[i][j + 1];
} }
Recent_AI[i][AI_AVG_SIZE - 1] = Values_AI[i]; Recent_AI[i][AI_AVG_SIZE - 1] = Values_AI[i];
*/
// 현재 인덱스 위치에 값을 저장
Recent_AI[i][index_AI] = Values_AI[i];
} }
// 인덱스를 증가시키고, 필요한 경우 순환
index_AI = (index_AI + 1) % AI_AVG_SIZE;
} }
void read_digital(){ void read_digital(){

@ -2,9 +2,19 @@ void Periodic_run(){
if(T_1ms){ if(T_1ms){
// Read Arduino AI // Read Arduino AI
read_analog(); // read_analog();
T_1ms = false; T_1ms = false;
} }
if(T_2ms){
// Read Arduino AI
read_analog(); // runtime of 1.xxx ms @8ch
T_2ms = false;
}
if(T_5ms){
// Read Arduino AI
//read_analog(); // runtime of 2.048012 ms @16ch
T_5ms = false;
}
if(T_10ms){ if(T_10ms){
//read_analog(); //read_analog();
T_10ms = false; T_10ms = false;
@ -40,6 +50,26 @@ void Periodic_run(){
write_buff(Buff_485_1_Wr, msg_MC9_PV(RS485_1_Addr[i])); write_buff(Buff_485_1_Wr, msg_MC9_PV(RS485_1_Addr[i]));
} }
} }
/*
float sum_AI = 0.0f;
float factor = 1.0f / AI_AVG_SIZE;
String str = "AI?:";
for (int i = 0; i < Size_AI; i++) {
int sum_AI = 0;
for(int j = 0; j < AI_AVG_SIZE; j++) {
sum_AI += (float) Recent_AI[i][j] * factor;
}
sum_AI *= 100.0f; // convert the sum to an integer representation
unsigned int integer_part = (unsigned int)sum_AI;
char formattedNumber[5]; // 4자리 숫자 + 널 종료 문자
//sprintf(formattedNumber, "%04X", Values_AI[i]); // 4자리로 고정된 형식의 문자열 생성
sprintf(formattedNumber, "%04X", integer_part); // 4자리로 고정된 형식의 문자열 생성
str += formattedNumber; // 형식화된 문자열 추가
str += ',';
}
Serial.println(str);
*/
T_1000ms = false; T_1000ms = false;
} }
if(T_2000ms){ if(T_2000ms){
@ -64,6 +94,12 @@ void timer_1ms(){
msCnt += 1; msCnt += 1;
T_1ms = true; T_1ms = true;
if (msCnt % 4 == 0){
T_2ms = true;
}
if (msCnt % 5 == 0){
T_5ms = true;
}
if (msCnt % 10 == 0){ if (msCnt % 10 == 0){
T_10ms = true; T_10ms = true;
} }

@ -1,16 +1,20 @@
String Prcss_ALL_Read(){ String Prcss_ALL_Read(){
String str = ""; String str = "";
float factor = 1.0f / AI_AVG_SIZE;
str += "AI?:"; str += "AI?:";
for (int i = 0; i < Size_AI; i++) { for (int i = 0; i < Size_AI; i++) {
int sum_AI = 0; float sum_AI = 0;
for(int j = 0; j < AI_AVG_SIZE; j++) { for(int j = 0; j < AI_AVG_SIZE; j++) {
sum_AI += Recent_AI[i][j]; sum_AI += (float) Recent_AI[i][j] * factor;
} }
sum_AI *= 50.0f; // convert the sum to an integer representation, Transfer data max(0xFFFF): 65,535. Each data max(10bit ADC): 1024. 1024 x 50 = 51,200
unsigned int integer_part = (unsigned int)sum_AI;
char formattedNumber[5]; // 4자리 숫자 + 널 종료 문자 char formattedNumber[5]; // 4자리 숫자 + 널 종료 문자
//sprintf(formattedNumber, "%04X", Values_AI[i]); // 4자리로 고정된 형식의 문자열 생성 //sprintf(formattedNumber, "%04X", Values_AI[i]); // 4자리로 고정된 형식의 문자열 생성
sprintf(formattedNumber, "%04X", sum_AI); // 4자리로 고정된 형식의 문자열 생성 sprintf(formattedNumber, "%04X", integer_part); // 4자리로 고정된 형식의 문자열 생성
str += formattedNumber; // 형식화된 문자열 추가 str += formattedNumber; // 형식화된 문자열 추가
str += ','; str += ',';
} }

@ -43,7 +43,7 @@ int recieve_485(){
// Timeout code // Timeout code
if(Wait_485_1){ if(Wait_485_1){
Wait_485_1_cnt++; Wait_485_1_cnt++;
if(Wait_485_1_cnt > 25){ // Timeout = periodic(20ms) x 25 = 500 msec if(Wait_485_1_cnt > 25){ // Timeout = periodic(20ms) x 20 = 400 msec
//Serial.println("485 not responced... (Timeout)"); //Serial.println("485 not responced... (Timeout)");
timeoutMC9(); timeoutMC9();
//if((latest_sent_msg == MC9_10_PV) ||(latest_sent_msg == MC9_10_SV)){ //if((latest_sent_msg == MC9_10_PV) ||(latest_sent_msg == MC9_10_SV)){

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{ {
"board": { "board": {
"active_layer": 37, "active_layer": 31,
"active_layer_preset": "", "active_layer_preset": "",
"auto_track_width": true, "auto_track_width": true,
"hidden_netclasses": [], "hidden_netclasses": [],
@ -15,17 +15,17 @@
"zones": 0.6 "zones": 0.6
}, },
"selection_filter": { "selection_filter": {
"dimensions": false, "dimensions": true,
"footprints": true, "footprints": true,
"graphics": false, "graphics": true,
"keepouts": false, "keepouts": true,
"lockedItems": false, "lockedItems": false,
"otherItems": false, "otherItems": true,
"pads": false, "pads": true,
"text": false, "text": true,
"tracks": false, "tracks": true,
"vias": false, "vias": true,
"zones": false "zones": true
}, },
"visible_items": [ "visible_items": [
0, 0,

@ -439,7 +439,7 @@
"last_paths": { "last_paths": {
"gencad": "", "gencad": "",
"idf": "", "idf": "",
"netlist": "", "netlist": "./",
"specctra_dsn": "", "specctra_dsn": "",
"step": "", "step": "",
"vrml": "" "vrml": ""

@ -2460,9 +2460,6 @@
(junction (at 106.68 30.48) (diameter 0) (color 0 0 0 0) (junction (at 106.68 30.48) (diameter 0) (color 0 0 0 0)
(uuid 98679850-3bcd-4a90-b6f2-f514d96f26ae) (uuid 98679850-3bcd-4a90-b6f2-f514d96f26ae)
) )
(junction (at 93.98 166.37) (diameter 0) (color 0 0 0 0)
(uuid a1141d8b-c74c-4bd0-afbd-2c60b4677880)
)
(junction (at 142.24 29.21) (diameter 0) (color 0 0 0 0) (junction (at 142.24 29.21) (diameter 0) (color 0 0 0 0)
(uuid b9d912cd-5d5c-407d-bacc-4d56e313a0b3) (uuid b9d912cd-5d5c-407d-bacc-4d56e313a0b3)
) )
@ -2510,10 +2507,6 @@
(stroke (width 0) (type default)) (stroke (width 0) (type default))
(uuid 044cbd82-0414-4cd2-abde-8a00550c2e1c) (uuid 044cbd82-0414-4cd2-abde-8a00550c2e1c)
) )
(wire (pts (xy 93.98 161.29) (xy 93.98 166.37))
(stroke (width 0) (type default))
(uuid 045ad5b3-cb4e-4e6f-84b8-306d30cee2db)
)
(wire (pts (xy 93.98 83.82) (xy 97.79 83.82)) (wire (pts (xy 93.98 83.82) (xy 97.79 83.82))
(stroke (width 0) (type default)) (stroke (width 0) (type default))
(uuid 05b1eb3d-14b8-46e5-b71a-2991f910cb5b) (uuid 05b1eb3d-14b8-46e5-b71a-2991f910cb5b)
@ -2602,10 +2595,6 @@
(stroke (width 0) (type default)) (stroke (width 0) (type default))
(uuid 1d41bd80-983b-4aa4-bff3-d5f4d799d126) (uuid 1d41bd80-983b-4aa4-bff3-d5f4d799d126)
) )
(wire (pts (xy 93.98 166.37) (xy 99.06 166.37))
(stroke (width 0) (type default))
(uuid 1d43dabf-e71d-4a5a-949a-8baac1002898)
)
(wire (pts (xy 203.2 115.57) (xy 210.82 115.57)) (wire (pts (xy 203.2 115.57) (xy 210.82 115.57))
(stroke (width 0) (type default)) (stroke (width 0) (type default))
(uuid 1f614d15-c7f7-4b26-af8f-a2b034a85a69) (uuid 1f614d15-c7f7-4b26-af8f-a2b034a85a69)
@ -2742,10 +2731,6 @@
(stroke (width 0) (type default)) (stroke (width 0) (type default))
(uuid 4213a033-312f-4925-adac-625b0d164905) (uuid 4213a033-312f-4925-adac-625b0d164905)
) )
(wire (pts (xy 99.06 161.29) (xy 93.98 161.29))
(stroke (width 0) (type default))
(uuid 42359107-d39d-42e1-ae31-2d0f9712903a)
)
(wire (pts (xy 125.73 39.37) (xy 129.54 39.37)) (wire (pts (xy 125.73 39.37) (xy 129.54 39.37))
(stroke (width 0) (type default)) (stroke (width 0) (type default))
(uuid 4350c89a-2637-4214-a95f-5e19cb88f71b) (uuid 4350c89a-2637-4214-a95f-5e19cb88f71b)
@ -3382,10 +3367,6 @@
(stroke (width 0) (type default)) (stroke (width 0) (type default))
(uuid e9f1e099-6b6a-43a9-b6a3-f0dc20f4ccd4) (uuid e9f1e099-6b6a-43a9-b6a3-f0dc20f4ccd4)
) )
(wire (pts (xy 99.06 166.37) (xy 99.06 163.83))
(stroke (width 0) (type default))
(uuid eaf47c35-ef99-4801-ba01-0c5e1217de72)
)
(wire (pts (xy 156.21 34.29) (xy 158.75 34.29)) (wire (pts (xy 156.21 34.29) (xy 158.75 34.29))
(stroke (width 0) (type default)) (stroke (width 0) (type default))
(uuid eb1ec8a7-4b78-412b-80e0-7746b367457f) (uuid eb1ec8a7-4b78-412b-80e0-7746b367457f)
@ -4657,31 +4638,6 @@
) )
) )
(symbol (lib_id "power:GND") (at 93.98 166.37 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 0bb826e6-8792-4246-bee8-1d5a2b6c1db9)
(property "Reference" "#PWR018" (at 93.98 172.72 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (at 93.98 171.45 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 93.98 166.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 93.98 166.37 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 99903bd5-8160-4fb5-b5a1-bb0fe39fb99b))
(instances
(project "megaPCB"
(path "/6969f8a3-205d-401c-ae37-2e26183a6afa"
(reference "#PWR018") (unit 1)
)
)
)
)
(symbol (lib_id "Connector:Conn_01x04_Pin") (at 173.99 54.61 0) (unit 1) (symbol (lib_id "Connector:Conn_01x04_Pin") (at 173.99 54.61 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid 114114d0-2df9-40ab-aa29-b92059ff0cc9) (uuid 114114d0-2df9-40ab-aa29-b92059ff0cc9)
@ -4751,7 +4707,7 @@
(property "Value" "R" (at 133.35 29.21 90) (property "Value" "R" (at 133.35 29.21 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 30.988 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 30.988 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 29.21 0) (property "Datasheet" "~" (at 133.35 29.21 0)
@ -4777,7 +4733,7 @@
(property "Value" "R" (at 162.56 34.29 90) (property "Value" "R" (at 162.56 34.29 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 162.56 36.068 90) (property "Footprint" "ScitechKorea:R250" (at 162.56 36.068 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 162.56 34.29 0) (property "Datasheet" "~" (at 162.56 34.29 0)
@ -4803,7 +4759,7 @@
(property "Value" "R" (at 133.35 46.99 90) (property "Value" "R" (at 133.35 46.99 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 48.768 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 48.768 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 46.99 0) (property "Datasheet" "~" (at 133.35 46.99 0)
@ -4882,7 +4838,7 @@
(property "Value" "R" (at 162.56 29.21 90) (property "Value" "R" (at 162.56 29.21 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 162.56 30.988 90) (property "Footprint" "ScitechKorea:R250" (at 162.56 30.988 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 162.56 29.21 0) (property "Datasheet" "~" (at 162.56 29.21 0)
@ -4908,7 +4864,7 @@
(property "Value" "R" (at 133.35 36.83 90) (property "Value" "R" (at 133.35 36.83 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 38.608 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 38.608 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 36.83 0) (property "Datasheet" "~" (at 133.35 36.83 0)
@ -4987,7 +4943,7 @@
(property "Value" "Arduino_Mega2560_Shield" (at 60.96 19.05 0) (property "Value" "Arduino_Mega2560_Shield" (at 60.96 19.05 0)
(effects (font (size 1.524 1.524))) (effects (font (size 1.524 1.524)))
) )
(property "Footprint" "ScitechKorea:mega_socket_no_center" (at 60.96 6.35 0) (property "Footprint" "ScitechKorea:mega_socket_simplest" (at 60.96 6.35 0)
(effects (font (size 1.524 1.524)) hide) (effects (font (size 1.524 1.524)) hide)
) )
(property "Datasheet" "https://docs.arduino.cc/hardware/mega-2560" (at 60.96 10.16 0) (property "Datasheet" "https://docs.arduino.cc/hardware/mega-2560" (at 60.96 10.16 0)
@ -5187,7 +5143,7 @@
(property "Value" "R" (at 133.35 41.91 90) (property "Value" "R" (at 133.35 41.91 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 43.688 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 43.688 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 41.91 0) (property "Datasheet" "~" (at 133.35 41.91 0)
@ -5264,7 +5220,7 @@
(property "Value" "R" (at 133.35 44.45 90) (property "Value" "R" (at 133.35 44.45 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 46.228 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 46.228 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 44.45 0) (property "Datasheet" "~" (at 133.35 44.45 0)
@ -5315,7 +5271,7 @@
(property "Value" "R" (at 162.56 36.83 90) (property "Value" "R" (at 162.56 36.83 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 162.56 38.608 90) (property "Footprint" "ScitechKorea:R250" (at 162.56 38.608 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 162.56 36.83 0) (property "Datasheet" "~" (at 162.56 36.83 0)
@ -5444,7 +5400,7 @@
(property "Value" "R" (at 133.35 39.37 90) (property "Value" "R" (at 133.35 39.37 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 41.148 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 41.148 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 39.37 0) (property "Datasheet" "~" (at 133.35 39.37 0)
@ -5502,7 +5458,7 @@
(property "Value" "R" (at 133.35 31.75 90) (property "Value" "R" (at 133.35 31.75 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 33.528 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 33.528 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 31.75 0) (property "Datasheet" "~" (at 133.35 31.75 0)
@ -5544,32 +5500,6 @@
) )
) )
(symbol (lib_id "Connector:Screw_Terminal_01x02") (at 104.14 161.29 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid bf432b4f-8aab-4257-96d7-f2fb4ce78f5d)
(property "Reference" "GND_0" (at 106.68 161.29 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "Screw_Terminal_01x02" (at 106.68 163.83 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "ScitechKorea:Terminal_02" (at 104.14 161.29 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 104.14 161.29 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 0033b868-0483-4804-8a0e-0c2162e34fce))
(pin "2" (uuid 5ab408ed-05b0-4862-98a5-6df5bfd6b6a5))
(instances
(project "megaPCB"
(path "/6969f8a3-205d-401c-ae37-2e26183a6afa"
(reference "GND_0") (unit 1)
)
)
)
)
(symbol (lib_id "Connector:Conn_01x04_Pin") (at 250.19 59.69 270) (unit 1) (symbol (lib_id "Connector:Conn_01x04_Pin") (at 250.19 59.69 270) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced) (in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid c429add8-fa46-4489-84eb-acde574b5075) (uuid c429add8-fa46-4489-84eb-acde574b5075)
@ -5632,7 +5562,7 @@
(property "Value" "R" (at 133.35 34.29 90) (property "Value" "R" (at 133.35 34.29 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 36.068 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 36.068 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 34.29 0) (property "Datasheet" "~" (at 133.35 34.29 0)
@ -5658,7 +5588,7 @@
(property "Value" "R" (at 162.56 24.13 90) (property "Value" "R" (at 162.56 24.13 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 162.56 25.908 90) (property "Footprint" "ScitechKorea:R250" (at 162.56 25.908 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 162.56 24.13 0) (property "Datasheet" "~" (at 162.56 24.13 0)
@ -5737,7 +5667,7 @@
(property "Value" "R" (at 162.56 26.67 90) (property "Value" "R" (at 162.56 26.67 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 162.56 28.448 90) (property "Footprint" "ScitechKorea:R250" (at 162.56 28.448 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 162.56 26.67 0) (property "Datasheet" "~" (at 162.56 26.67 0)
@ -5850,7 +5780,7 @@
(property "Value" "R" (at 162.56 31.75 90) (property "Value" "R" (at 162.56 31.75 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 162.56 33.528 90) (property "Footprint" "ScitechKorea:R250" (at 162.56 33.528 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 162.56 31.75 0) (property "Datasheet" "~" (at 162.56 31.75 0)
@ -5951,7 +5881,7 @@
(property "Value" "R" (at 133.35 26.67 90) (property "Value" "R" (at 133.35 26.67 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 28.448 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 28.448 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 26.67 0) (property "Datasheet" "~" (at 133.35 26.67 0)
@ -6002,7 +5932,7 @@
(property "Value" "R" (at 133.35 24.13 90) (property "Value" "R" (at 133.35 24.13 90)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (at 133.35 25.908 90) (property "Footprint" "ScitechKorea:R250" (at 133.35 25.908 90)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Datasheet" "~" (at 133.35 24.13 0) (property "Datasheet" "~" (at 133.35 24.13 0)

@ -0,0 +1,80 @@
/*
* Modifed from UIPEthernet EchoServer example.
*
* UIPEthernet is a TCP/IP stack that can be used with a enc28j60 based
* Ethernet-shield.
*
*/
#define DEBUG 1
#define MACADDRESS 0x00,0x01,0x02,0x03,0x04,0x05
#define MYIPADDR 192,168,20,177
#define MYIPMASK 255,255,255,0
#define MYDNS 192,168,20,1
#define MYGW 192,168,20,1
#define LISTENPORT 5025
#define UARTBAUD 115200
#include <UIPEthernet.h>
#include <UIPServer.h>
#include <UIPClient.h>
#include "utility/logging.h"
uint8_t mac[6] = {MACADDRESS};
uint8_t myIP[4] = {MYIPADDR};
uint8_t myMASK[4] = {MYIPMASK};
uint8_t myDNS[4] = {MYDNS};
uint8_t myGW[4] = {MYGW};
EthernetClient client;
EthernetServer server = EthernetServer(LISTENPORT);
void setup() {
Serial.begin(9600);
Ethernet.begin(mac,myIP,myDNS,myGW,myMASK);
// start listening for clients
server.begin();
}
void loop() {
size_t size;
String message = "";
client = server.available();
if (client){
Serial.println("Client Connected!!!");
while(client.connected()){
// Recive Command
if((size = client.available()) > 0){
uint8_t* msg = (uint8_t*)malloc(size);
size = client.read(msg,size);
for(int i = 0 ; i < size ; i++){
message += (char)msg[i];
}
if(size > 2){
if((msg[size-1] == '\n') && (msg[size-2] == '\r')){
#if DEBUG
Serial.print(size);
Serial.println(" >> " + message);
#endif
//cmd = demuxCMD(message, &cmdData); // for IFB
client.print(message);
message = "";
}
}
free(msg);
}
// Action by Command
//if(cmd)
}
Serial.println("Client Disconnected...");
}
}
Loading…
Cancel
Save