Looks like there is code here, in a ZIP file.
This appears to be the code on the Teensy 4.1.
Code:
#include <NativeEthernet.h>
//#include <SPI.h>
//#include <NativeEthernet.h>
unsigned long Position = 0, Facedelay = 0;
int currentposition = 0, pos = 0, linear = 0;
int i = 0, servo1 = 9, servo2 = 10;
bool mode_ = 0;
byte mac[] = {
0x04, 0xE9, 0xE5, 0x0C, 0xA4, 0x27
};
IPAddress ip(192, 168, 127, 177);
EthernetServer server(80);
void setup() {
pinMode(servo1, OUTPUT);// put your setup code here, to run once:
pinMode(servo2, OUTPUT);
digitalWrite(servo2, LOW);
// Open serial communications and wait for port to open:
Serial.begin(9600);
//while (!Serial) {
//; // wait for serial port to connect. Needed for native USB port only
//}
//Serial.println("Ethernet WebServer Example");
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
//Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
//Serial.println("Ethernet cable is not connected.");
}
// start the server
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}
void forward()
{
digitalWrite(servo2, LOW);
for (i = 0; i <= pos; i++)
{
digitalWrite(servo1, HIGH);
delayMicroseconds(500);
digitalWrite(servo1, LOW);
delayMicroseconds(500);
}
}
void reverse()
{
digitalWrite(servo2, HIGH);
for (i = 0; i <= pos; i++)
{
digitalWrite(servo1, HIGH);
delayMicroseconds(500);
digitalWrite(servo1, LOW);
delayMicroseconds(500);
}
}
void loop() {
// listen for incoming clients
EthernetClient client = server.available();
if (client) {
client.println("Ready");
while (client.connected()) {
if (client.available()) {
String msg = client.readString();
Serial.print(msg);
}
if (Serial.available()) {
String cmd = Serial.readString();
client.print(cmd);
}
}
}
}
And I'm guessing this is the code running on Arduino Uno
Code:
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x04, 0xE9, 0xE5, 0x0C, 0xA4, 0x26 };
IPAddress server(192, 168, 127, 177);
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 127, 150);
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
// Variables to measure the speed
unsigned long beginMicros, endMicros;
unsigned long byteCount = 0;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// start the Ethernet connection:
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac,ip);
} else {
Serial.print(" DHCP assigned IP ");
Serial.println(Ethernet.localIP());
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.print("connecting to ");
Serial.print(server);
Serial.println("...");
// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.print("connected to ");
Serial.println(client.remoteIP());
client.println("Ready");
client.println();
} else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
beginMicros = micros();
}
void loop() {
// if there are incoming bytes available
// from the server, read them and print them:
while (client.connected()) {
if (client.available()) {
String msg;
msg = client.readString();
Serial.print(msg);
}
if (Serial.available()) {
String cmd;
cmd = Serial.readString();
delayMicroseconds(1);
client.print(cmd);
Serial.print(cmd);
}
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.print("connecting to ");
Serial.print(server);
Serial.println("...");
// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.print("connected to ");
Serial.println(client.remoteIP());
client.println("Ready");
client.println();
}
endMicros = micros();
Serial.println();
Serial.println("disconnecting.");
client.stop();
Serial.print("Received ");
Serial.print(byteCount);
Serial.print(" bytes in ");
float seconds = (float)(endMicros - beginMicros) / 1000000.0;
Serial.print(seconds, 4);
float rate = (float)byteCount / seconds / 1000.0;
Serial.print(", rate = ");
Serial.print(rate);
Serial.print(" kbytes/second");
Serial.println();
// do nothing forevermore:
while (true) {
delay(1);
}
}
}