Improve gitignore for PlatformIO + macOS

This commit is contained in:
Jarrad Ashton Brown 2026-02-26 16:03:14 -06:00
parent 1668ca09e5
commit e2347c29d2
4 changed files with 61 additions and 17 deletions

BIN
.DS_Store vendored

Binary file not shown.

11
.gitignore vendored Normal file
View file

@ -0,0 +1,11 @@
#
# macOS junk
.DS_Store
**/.DS_Store
# PlatformIO build + deps (ANY folder)
**/.pio/
.platformio/
# VS Code (all subprojects)
**/.vscode/

View file

@ -1,5 +0,0 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

View file

@ -1,21 +1,59 @@
#include <Arduino.h> #include <Arduino.h>
#include <QNEthernet.h>
// put function declarations here: using namespace qindesign::network;
int myFunction(int, int);
// Network config
IPAddress ip(192, 168, 1, 177); // change to your network
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
EthernetUDP udp;
const uint16_t localPort = 2222; // EtherNet/IP uses 2222 (good test)
void setup() { void setup() {
// put your setup code here, to run once: Serial.begin(115200);
int result = myFunction(2, 3); delay(2000);
Serial.println("Starting Ethernet...");
Ethernet.begin(ip, subnet, gateway);
if (!Ethernet.linkStatus()) {
Serial.println("Ethernet cable not connected!");
}
Serial.print("IP: ");
Serial.println(Ethernet.localIP());
udp.begin(localPort);
Serial.print("Listening on UDP port: ");
Serial.println(localPort);
} }
void loop() { void loop() {
// put your main code here, to run repeatedly: int packetSize = udp.parsePacket();
int data = myFunction(50,1);
Serial.print((int)data); if (packetSize) {
delay(1000); Serial.print("Received packet: ");
Serial.println(packetSize);
char buffer[512];
int len = udp.read(buffer, sizeof(buffer));
if (len > 0) {
buffer[len] = 0;
} }
// put function definitions here: Serial.print("Data: ");
int myFunction(int x, int y) { Serial.println(buffer);
return x + y;
// Echo back
udp.beginPacket(udp.remoteIP(), udp.remotePort());
udp.write((const uint8_t*)"ACK", 3);
udp.endPacket();
Serial.println("Sent ACK");
}
} }