version 1.1

This commit is contained in:
cally22
2023-07-09 20:02:24 +02:00
parent 6cc938d45b
commit 9161792f28
4 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ void OledDisplay::writeLine(char* msg, int line) {
y -= 5 * 10; y -= 5 * 10;
} }
display.setCursor(x, y); display.setCursor(x, y);
display.print(" "); // Print spaces to clear the line display.print(" "); // Print spaces to clear the line
display.setCursor(x, y); display.setCursor(x, y);
display.print(msg); display.print(msg);
display.display(); display.display();
+4
View File
@@ -0,0 +1,4 @@
#DroneController
Is a Arduino Script for controlling a drone with a controller
+3 -8
View File
@@ -26,19 +26,14 @@ void RadioController::setup(int cepin, int cspin) {
Serial.println("Error initializing radio"); Serial.println("Error initializing radio");
} else { } else {
Serial.println("Succesfully initializing radio"); Serial.println("Succesfully initializing radio");
// radio.openWritingPipe(writePipe);
// radio.openReadingPipe(1, readPipe);
// radio.setPALevel(RF24_PA_MAX);
// radio.disableDynamicPayloads();
// radio.setAutoAck(false);
// radio.setDataRate( RF24_250KBPS );
// radio.enableAckPayload();
// radio.setRetries(15, 15); // delay, count // radio.setRetries(15, 15); // delay, count
radio.setDataRate( RF24_250KBPS );
// Set the PA Level low to try preventing power supply related problems // Set the PA Level low to try preventing power supply related problems
// because these examples are likely run with nodes in close proximity to // because these examples are likely run with nodes in close proximity to
// each other. // each other.
radio.setPALevel(RF24_PA_LOW); // RF24_PA_MAX is default. radio.setPALevel(RF24_PA_HIGH); // RF24_PA_MAX is default.
// to use ACK payloads, we need to enable dynamic payload lengths (for all nodes) // to use ACK payloads, we need to enable dynamic payload lengths (for all nodes)
radio.enableDynamicPayloads(); // ACK payloads are dynamically sized radio.enableDynamicPayloads(); // ACK payloads are dynamically sized
-1
View File
@@ -74,7 +74,6 @@ void loop() {
previousTime = currentTime; // Update the previous time previousTime = currentTime; // Update the previous time
} }
if (digitalRead(left_button) == LOW) { if (digitalRead(left_button) == LOW) {
strcat(msgToSend, "Stop|"); strcat(msgToSend, "Stop|");
} else if (digitalRead(up_button) == LOW) { } else if (digitalRead(up_button) == LOW) {