I think the traces of Blink4Terry are too thin, so I do some changes to the PCB design.
In the PCB design of Fusion 360, I can set the design rules via clicking the ‘DRC tick mark’.
And In the ‘Sizes’, set the minimum width bigger or equal to 15mil.
Then reconnect all the traces.
Then export and turn it to gcode via mods, send the gcode to the machine via EdytorNC.
// Pin configintbutton=2;intled=4;// values for morse code, https://morsecode.world/international/timing.htmlintunit=100;// base time unit for morse code, smaller is fasterintdot=unit;// same as dit (.)intdash=unit*3;// same as dah (-)intintra_char_space=unit;// the gap between dits and dahs within a characterintinter_char_space=unit*3;// the gap between the characters of a wordintword_space=unit*7;// the gap between two words// status values of buttonintpressed=0;voidsetup(){Serial.begin(9600);pinMode(led,OUTPUT);pinMode(button,INPUT);}// functions of breathing lightvoidbreathing(){for(inti=0;i<255;i++){analogWrite(led,i);delay(1);}for(inti=255;i>0;i--){analogWrite(led,i);delay(1);}}// functions of morse code// "_" is used for spaces in between words. Every char already ends with a inter_char_space of 3 time units.void_(){delay(word_space-inter_char_space);}voids(){// ...analogWrite(led,255);delay(dot);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dot);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dot);analogWrite(led,0);delay(inter_char_space);}voido(){// ---analogWrite(led,255);delay(dash);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dash);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dash);analogWrite(led,0);delay(inter_char_space);}voidloop(){pressed=digitalRead(button);if(pressed==LOW){// if pressed = true// SOS ···---···s();o();s();_();}else{// if pressed = falsebreathing();}}
It works~ ^^
Then, I went further on making the communications part.
For making SAMD11 boards communicate together, I’ve lookup the Datasheet.
And found out that to make them communicate, I need to connect input board TX1 to output board RX1 and input board RX1 to output board TX1.
// Pin configintbutton=2;intled=4;// values for morse code, https://morsecode.world/international/timing.htmlintunit=100;// base time unit for morse code, smaller is fasterintdot=unit;// same as dit (.)intdash=unit*3;// same as dah (-)intintra_char_space=unit;// the gap between dits and dahs within a characterintinter_char_space=unit*3;// the gap between the characters of a wordintword_space=unit*7;// the gap between two words// status values of buttonintpressed=0;voidsetup(){Serial.begin(9600);Serial1.begin(9600);// sets the data rate in bits per second (baud) for serial1 data tranmission (SAMD11C PA30-TX1 PA31-RX1)pinMode(led,OUTPUT);pinMode(button,INPUT);}// functions of morse code// "_" is used for spaces in between words. Every char already ends with a inter_char_space of 3 time units.void_(){delay(word_space-inter_char_space);}voids(){// ...analogWrite(led,255);delay(dot);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dot);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dot);analogWrite(led,0);delay(inter_char_space);}voido(){// ---analogWrite(led,255);delay(dash);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dash);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dash);analogWrite(led,0);delay(inter_char_space);}voidloop(){pressed=digitalRead(button);if(pressed==LOW){// if pressed = true// SOS ···---···Serial1.println('1');s();o();s();_();}else{// if pressed = false}}
// Pin configintbutton=2;intled=4;// values for morse code, https://morsecode.world/international/timing.htmlintunit=100;// base time unit for morse code, smaller is fasterintdot=unit;// same as dit (.)intdash=unit*3;// same as dah (-)intintra_char_space=unit;// the gap between dits and dahs within a characterintinter_char_space=unit*3;// the gap between the characters of a wordintword_space=unit*7;// the gap between two words// status values of buttonintpressed=0;StringreadString;voidsetup(){Serial.begin(9600);Serial1.begin(9600);// sets the data rate in bits per second (baud) for serial1 data tranmission (SAMD11C PA30-TX1 PA31-RX1)pinMode(led,OUTPUT);pinMode(button,INPUT);}// functions of morse code// "_" is used for spaces in between words. Every char already ends with a inter_char_space of 3 time units.void_(){delay(word_space-inter_char_space);}voids(){// ...analogWrite(led,255);delay(dot);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dot);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dot);analogWrite(led,0);delay(inter_char_space);}voido(){// ---analogWrite(led,255);delay(dash);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dash);analogWrite(led,0);delay(intra_char_space);analogWrite(led,255);delay(dash);analogWrite(led,0);delay(inter_char_space);}voidloop(){while(Serial1.available()){delay(2);//delay to allow byte to arrive in input buffercharc=Serial1.read();readString+=c;}if(readString.length()>0){Serial1.println(readString);s();o();s();_();readString="";}}