├── .gitignore ├── Images ├── 1.front.jpg ├── 2.programming_ports.jpg ├── 3.charging_port.jpg └── 4.On-Off_button.jpg ├── README.md ├── Remote_TX ├── Remote_TX.ino ├── debug.h ├── example.config.h ├── init.h ├── tx_default.h ├── tx_package.h ├── tx_set_data.h └── util.h └── STL ├── 1.remote_top.stl ├── 10.RotaryEncoderSpacer.stl ├── 11.On_Off_Switches_lock.stl ├── 12.Potentiometers_Lock.stl ├── 13.Lambda80_Holder_A.stl ├── 14.Lambda80_Holder_B.stl ├── 2.remote_middle.stl ├── 3.remote_bottom.stl ├── 4.1.battery_holder_plate.stl ├── 4.2.1.battery_holder_charging_port.stl ├── 4.2.2.battery_holder_charging_port.stl ├── 4.3.battery_holder_programming_port.stl ├── 4.4.battery_holder_cover.stl ├── 5.MCP23017_Holder.stl ├── 6.ScreenHolder_1.stl ├── 7.ADC+PGA_MPU6050.stl ├── 8.Esp32_Holder_Left.stl ├── 9.Esp32_Holder_Right.stl ├── A.model_top_middle_bottom.stl └── B.model_with_connectors.stl /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | .DS_Store 3 | config.h 4 | *.svd 5 | *.cfg 6 | *.json 7 | -------------------------------------------------------------------------------- /Images/1.front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/Images/1.front.jpg -------------------------------------------------------------------------------- /Images/2.programming_ports.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/Images/2.programming_ports.jpg -------------------------------------------------------------------------------- /Images/3.charging_port.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/Images/3.charging_port.jpg -------------------------------------------------------------------------------- /Images/4.On-Off_button.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/Images/4.On-Off_button.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP32-Transmitter 2 | 3 | 4 | **Required Parts:** 5 | - https://docs.google.com/spreadsheets/d/1zQqSlJfUWGqs_R1aqBwqtA5bVyoDV9SjKWJwAQXIoj8/edit?usp=sharing 6 | 7 | 8 | **Pinout connections:** 9 | - https://docs.google.com/spreadsheets/d/15OYmpq7AMzw1vtq4MAzwQhLx2pZ3nnZ8iWz8i1XycnE/edit?usp=sharing 10 | -------------------------------------------------------------------------------- /Remote_TX/Remote_TX.ino: -------------------------------------------------------------------------------- 1 | // Include the required libraries and config files 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "init.h" 10 | #include "config.h" 11 | #include "tx_package.h" 12 | #include "tx_default.h" 13 | #include "tx_set_data.h" 14 | #include "util.h" 15 | 16 | static int taskCore1 = 0; 17 | static int taskCore2 = 1; 18 | TaskHandle_t task_txSetData; 19 | TaskHandle_t task_txSendData; 20 | 21 | /** 22 | * Use core 0 to read the inputs 23 | */ 24 | void func_txSetData( void * pvParameters ){ 25 | while(true){ 26 | /* 27 | ads1115 read 28 | */ 29 | joysticksSetData(); 30 | 31 | /* 32 | Rotary 1 33 | */ 34 | anoRotaryEncoder1SetData(); 35 | 36 | /* 37 | Rotary 2 38 | */ 39 | anoRotaryEncoder2SetData(); 40 | 41 | /* 42 | Potentiometers 43 | */ 44 | potentiometersSetData(); 45 | 46 | // Switches 47 | switchesSetData(); 48 | } 49 | } 50 | 51 | /** 52 | * Use core 1 to send the data 53 | */ 54 | void func_txSendData( void * pvParameters ){ 55 | while(true){ 56 | /* 57 | Radio Transmit 58 | */ 59 | if(transmittedFlag) { 60 | enableInterrupt = false; 61 | transmittedFlag = false; 62 | radio.finishTransmit(); 63 | int state = radio.startTransmit(packageData.byteArray, sizeof(packageData.byteArray)); 64 | enableInterrupt = true; 65 | } 66 | 67 | if (enableSerialPrint) { 68 | Serial.print("[SX1280] Transmitting packet ( "); 69 | Serial.print(sizeof(packageData.byteArray)); 70 | Serial.print(" ) ... "); 71 | Serial.println(""); 72 | } 73 | } 74 | } 75 | 76 | void setup() { 77 | if(enableSerialPrint) { 78 | Serial.begin(115200); 79 | } 80 | 81 | // Load the default values 82 | defaultValues(); 83 | 84 | // Enable the INPUT_PULLUP for the potentiometers 85 | potentiometersInit(); 86 | 87 | /* 88 | MCP23017 89 | */ 90 | // MCP1 - Init 91 | mcp1Init(); 92 | 93 | // MCP2 - Init 94 | mcp2Init(); 95 | 96 | // SX1280 97 | sx1280Init(); 98 | 99 | // ads1115 100 | ads1115Init(); 101 | 102 | xTaskCreatePinnedToCore( 103 | func_txSetData, // Function to implement the task 104 | "task_txSetData", // Name of the task 105 | 10000, // Stack size in words 106 | NULL, // Task input parameter 107 | 4, // Priority of the task 108 | &task_txSetData, // Task handle 109 | taskCore1 // Core where the task should run 110 | ); 111 | 112 | xTaskCreatePinnedToCore( 113 | func_txSendData, // Function to implement the task 114 | "task_txSendData", // Name of the task 115 | 10000, // Stack size in words 116 | NULL, // Task input parameter 117 | 3, // Priority of the task 118 | &task_txSendData, // Task handle 119 | taskCore2 // Core where the task should run 120 | ); 121 | 122 | } 123 | 124 | void loop() { 125 | } 126 | -------------------------------------------------------------------------------- /Remote_TX/debug.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/Remote_TX/debug.h -------------------------------------------------------------------------------- /Remote_TX/example.config.h: -------------------------------------------------------------------------------- 1 | // Debug 2 | bool enableSerialPrint = false; 3 | 4 | // MCP23017 5 | #define MCP23X17_addr1 0x25 6 | #define MCP23X17_addr2 0x26 7 | 8 | // ads1115 9 | #define ADS1115_addr1 0x48 10 | 11 | //Switch Button 12 | #define buttonSwitch_1 15 13 | #define buttonSwitch_2 14 14 | #define buttonSwitch_3 13 15 | #define buttonSwitch_4 12 16 | #define buttonSwitch_5 11 17 | 18 | //Pot Switch Button 19 | #define buttonSwitchPot_1 3 20 | #define buttonSwitchPot_2 2 21 | #define buttonSwitchPot_3 1 22 | #define buttonSwitchPot_4 0 23 | #define buttonSwitchPot_5 4 24 | #define buttonSwitchPot_6 5 25 | 26 | //Rotary 1 Buttons 27 | #define rotary1_1 11 28 | #define rotary1_2 12 29 | #define rotary1_3 13 30 | #define rotary1_4 14 31 | #define rotary1_5 15 32 | #define rotary1_enc_1 9 33 | #define rotary1_enc_2 10 34 | 35 | //Rotary 2 Buttons 36 | #define rotary2_1 0 37 | #define rotary2_2 1 38 | #define rotary2_3 2 39 | #define rotary2_4 3 40 | #define rotary2_5 4 41 | #define rotary2_enc_1 6 42 | #define rotary2_enc_2 5 43 | 44 | /* 45 | Potentiometers 46 | */ 47 | #define POTENTIOMETER_PIN1 A1 //25 48 | #define POTENTIOMETER_PIN2 A10 //27 49 | #define POTENTIOMETER_PIN3 A12 //13 50 | #define POTENTIOMETER_PIN4 A8 //15 51 | #define POTENTIOMETER_PIN5 A9 //33 52 | #define POTENTIOMETER_PIN6 A7 //32 53 | int potSensitivityValue = 2; 54 | 55 | // Joystick Values 56 | int joystickMaxValue = 26598; // Max possible value 57 | int joystickSensitivityValue = 500; // This is used for the joystick sensitivity 58 | 59 | /* 60 | SX1280 has the following connections: 61 | NSS pin: 2 62 | DIO1 pin: 26 63 | NRST pin: 14 64 | BUSY pin: 21 65 | */ 66 | 67 | SX1280 radio = new Module(2, 26, 14, 21); 68 | 69 | float frequency = 2400.0; 70 | int bitRate = 520; 71 | int codingRate = 2; 72 | int outputPower = 8; 73 | float dataShaping = 1.0; 74 | uint8_t syncWord[] = {0x01, 0x23, 0x45, 0x67}; 75 | int crcValue = 0; 76 | -------------------------------------------------------------------------------- /Remote_TX/init.h: -------------------------------------------------------------------------------- 1 | // Rotary encoder 2 | RotaryEncoder *encoder1 = nullptr; 3 | RotaryEncoder *encoder2 = nullptr; 4 | 5 | // MCP23017 6 | /* 7 | Addr(BIN) Addr(hex) param 8 | 010 0111 0x27 7 9 | 010 0110 0x26 6 10 | 010 0101 0x25 5 11 | 010 0100 0x24 4 12 | 010 0011 0x23 3 13 | 010 0010 0x22 2 14 | 010 0001 0x21 1 15 | 010 0000 0x20 0 16 | */ 17 | Adafruit_MCP23X17 mcp1; 18 | Adafruit_MCP23X17 mcp2; 19 | 20 | int16_t 21 | // Potentiometer Values 22 | pot1, pot2, pot3, pot4, pot5, pot6, 23 | 24 | // Potentiometer AnalogRead 25 | pot1Read, pot2Read, pot3Read, pot4Read, pot5Read, pot6Read, 26 | 27 | // Potentiometer AnalogRead 28 | pot1LastValue, pot2LastValue, pot3LastValue, pot4LastValue, pot5LastValue, pot6LastValue, 29 | 30 | // Potentiometer On/Off values 31 | potSwitch1, potSwitch2, potSwitch3, potSwitch4, potSwitch5, potSwitch6, 32 | 33 | // On/Off switch values 34 | switch1, switch2, switch3, switch4, switch5, 35 | 36 | // ANO Rotary Navigation #1 37 | rotary1_up, rotary1_down, rotary1_left, rotary1_right, rotary1_center, rotary1_enc1, rotary1_enc2, 38 | 39 | // ANO Rotary Navigation #2 40 | rotary2_up, rotary2_down, rotary2_left, rotary2_right, rotary2_center, rotary2_enc1, rotary2_enc2, 41 | pos = 0; 42 | 43 | 44 | // ads1115 45 | Adafruit_ADS1115 ads; 46 | int16_t adc0, adc1, adc2, adc3, adc0_map, adc1_map, adc2_map, adc3_map, j1xMiddle, j1yMiddle, j2xMiddle, j2yMiddle; 47 | 48 | // SX128x 49 | // flag to indicate that a packet was sent 50 | volatile bool transmittedFlag = false; 51 | 52 | // disable interrupt when it's not needed 53 | volatile bool enableInterrupt = true; 54 | -------------------------------------------------------------------------------- /Remote_TX/tx_default.h: -------------------------------------------------------------------------------- 1 | /** 2 | * tx_default.h 3 | * set the current default values 4 | */ 5 | 6 | void defaultValues() { 7 | // J1 8 | packageData.structure.j1x = 127; // left-right 9 | packageData.structure.j1y = 127; // up-down 10 | 11 | // J2 12 | packageData.structure.j2x = 127; // left-right 13 | packageData.structure.j2y = 127; // up-down 14 | 15 | // Pots 16 | packageData.structure.p1 = 0; 17 | packageData.structure.p2 = 0; 18 | packageData.structure.p3 = 0; 19 | packageData.structure.p4 = 0; 20 | packageData.structure.p5 = 0; 21 | packageData.structure.p6 = 0; 22 | packageData.structure.p1s = 0; 23 | packageData.structure.p2s = 0; 24 | packageData.structure.p3s = 0; 25 | packageData.structure.p4s = 0; 26 | packageData.structure.p5s = 0; 27 | packageData.structure.p6s = 0; 28 | 29 | // Switches 30 | packageData.structure.s1 = 0; 31 | packageData.structure.s2 = 0; 32 | packageData.structure.s3 = 0; 33 | packageData.structure.s4 = 0; 34 | packageData.structure.s5 = 0; 35 | 36 | // Ano Rotary Encoder - Left 37 | packageData.structure.re1_up = 0; 38 | packageData.structure.re1_down = 0; 39 | packageData.structure.re1_left = 0; 40 | packageData.structure.re1_right = 0; 41 | packageData.structure.re1_center = 0; 42 | packageData.structure.re1_dir = 0; 43 | 44 | // Ano Rotary Encoder - Right 45 | packageData.structure.re2_up = 0; 46 | packageData.structure.re2_down = 0; 47 | packageData.structure.re2_left = 0; 48 | packageData.structure.re2_right = 0; 49 | packageData.structure.re2_center = 0; 50 | packageData.structure.re2_dir = 0; 51 | } 52 | -------------------------------------------------------------------------------- /Remote_TX/tx_package.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tx_package.h 3 | */ 4 | 5 | typedef struct package { 6 | // Left Joystick 7 | byte j1x; // left-right 8 | byte j1y; // up-down 9 | 10 | // Right Joystick 11 | byte j2x; // left-right 12 | byte j2y; // up-down 13 | 14 | // Potentiometers - Values 15 | byte p1; 16 | byte p2; 17 | byte p3; 18 | byte p4; 19 | byte p5; 20 | byte p6; 21 | 22 | // Potentiometers - Switches 23 | byte p1s; 24 | byte p2s; 25 | byte p3s; 26 | byte p4s; 27 | byte p5s; 28 | byte p6s; 29 | 30 | // Switches 31 | byte s1; 32 | byte s2; 33 | byte s3; 34 | byte s4; 35 | byte s5; 36 | 37 | // Ano Rotary Encoder - Left 38 | byte re1_up; 39 | byte re1_down; 40 | byte re1_left; 41 | byte re1_right; 42 | byte re1_center; 43 | char re1_dir; 44 | 45 | // Ano Rotary Encoder - Right 46 | byte re2_up; 47 | byte re2_down; 48 | byte re2_left; 49 | byte re2_right; 50 | byte re2_center; 51 | char re2_dir; 52 | }; 53 | const int union_size = sizeof(package); 54 | 55 | typedef union btPacket_t{ 56 | package structure; 57 | byte byteArray[union_size]; 58 | }; 59 | 60 | btPacket_t packageData; //Create a variable with the above structure 61 | -------------------------------------------------------------------------------- /Remote_TX/tx_set_data.h: -------------------------------------------------------------------------------- 1 | /** 2 | * tx_read.h 3 | */ 4 | 5 | void potentiometersSetData() { 6 | /* 7 | Potentiometer Values 8 | */ 9 | pot1Read = analogRead(POTENTIOMETER_PIN1); 10 | pot2Read = analogRead(POTENTIOMETER_PIN1); 11 | pot3Read = analogRead(POTENTIOMETER_PIN1); 12 | pot4Read = analogRead(POTENTIOMETER_PIN1); 13 | pot5Read = analogRead(POTENTIOMETER_PIN1); 14 | pot6Read = analogRead(POTENTIOMETER_PIN1); 15 | 16 | pot1LastValue = ((pot1LastValue > pot1Read + potSensitivityValue) || (pot1LastValue < pot1Read - potSensitivityValue)) ? pot1Read : pot1LastValue; 17 | pot2LastValue = ((pot2LastValue > pot2Read + potSensitivityValue) || (pot2LastValue < pot2Read - potSensitivityValue)) ? pot2Read : pot2LastValue; 18 | pot3LastValue = ((pot3LastValue > pot3Read + potSensitivityValue) || (pot3LastValue < pot3Read - potSensitivityValue)) ? pot3Read : pot3LastValue; 19 | pot4LastValue = ((pot4LastValue > pot4Read + potSensitivityValue) || (pot4LastValue < pot4Read - potSensitivityValue)) ? pot4Read : pot4LastValue; 20 | pot5LastValue = ((pot5LastValue > pot5Read + potSensitivityValue) || (pot5LastValue < pot5Read - potSensitivityValue)) ? pot5Read : pot5LastValue; 21 | pot6LastValue = ((pot6LastValue > pot6Read + potSensitivityValue) || (pot6LastValue < pot6Read - potSensitivityValue)) ? pot6Read : pot6LastValue; 22 | 23 | packageData.structure.p1 = map(pot1LastValue, 0, 4095, 255, 0); 24 | packageData.structure.p2 = map(pot2LastValue, 0, 4095, 255, 0); 25 | packageData.structure.p3 = map(pot3LastValue, 0, 4095, 255, 0); 26 | packageData.structure.p4 = map(pot4LastValue, 0, 4095, 255, 0); 27 | packageData.structure.p5 = map(pot5LastValue, 0, 4095, 0, 255); 28 | packageData.structure.p6 = map(pot6LastValue, 0, 4095, 255, 0); 29 | 30 | /* 31 | Potentiometer Switches 32 | */ 33 | packageData.structure.p1s = !mcp2.digitalRead(buttonSwitchPot_1); 34 | packageData.structure.p2s = !mcp2.digitalRead(buttonSwitchPot_2); 35 | packageData.structure.p3s = !mcp2.digitalRead(buttonSwitchPot_3); 36 | packageData.structure.p4s = !mcp2.digitalRead(buttonSwitchPot_4); 37 | packageData.structure.p5s = !mcp2.digitalRead(buttonSwitchPot_5); 38 | packageData.structure.p6s = !mcp2.digitalRead(buttonSwitchPot_6); 39 | } 40 | 41 | void switchesSetData() { 42 | packageData.structure.s1 = mcp1.digitalRead(buttonSwitch_1); 43 | packageData.structure.s2 = mcp1.digitalRead(buttonSwitch_2); 44 | packageData.structure.s3 = mcp1.digitalRead(buttonSwitch_3); 45 | packageData.structure.s4 = mcp1.digitalRead(buttonSwitch_4); 46 | packageData.structure.s5 = mcp1.digitalRead(buttonSwitch_5); 47 | } 48 | 49 | void anoRotaryEncoder2SetData() { 50 | int encoder_direction = 0; 51 | 52 | packageData.structure.re2_up = !mcp1.digitalRead(rotary2_2); 53 | packageData.structure.re2_down = !mcp1.digitalRead(rotary2_4); 54 | packageData.structure.re2_left = !mcp1.digitalRead(rotary2_3); 55 | packageData.structure.re2_right = !mcp1.digitalRead(rotary2_5); 56 | packageData.structure.re2_center = !mcp1.digitalRead(rotary2_1); 57 | 58 | encoder2->tick( 59 | mcp1.digitalRead(rotary2_enc_1), 60 | mcp1.digitalRead(rotary2_enc_2) 61 | ); 62 | 63 | int newPos = encoder2->getPosition(); 64 | 65 | packageData.structure.re2_dir = 0; 66 | if (pos != newPos) { 67 | pos = newPos; 68 | encoder_direction = (int)encoder2->getDirection(); 69 | } 70 | packageData.structure.re2_dir = encoder_direction; 71 | } 72 | 73 | void anoRotaryEncoder1SetData() { 74 | int encoder_direction = 0; 75 | 76 | encoder1->tick( 77 | mcp2.digitalRead(rotary1_enc_1), 78 | mcp2.digitalRead(rotary1_enc_2) 79 | ); 80 | int newPos = encoder1->getPosition(); 81 | 82 | packageData.structure.re1_dir = 0; 83 | if (pos != newPos) { 84 | pos = newPos; 85 | encoder_direction = (int)encoder1->getDirection(); 86 | } 87 | 88 | packageData.structure.re1_dir = encoder_direction; 89 | packageData.structure.re1_up = !mcp2.digitalRead(rotary1_4); 90 | packageData.structure.re1_down = !mcp2.digitalRead(rotary1_2); 91 | packageData.structure.re1_left = !mcp2.digitalRead(rotary1_3); 92 | packageData.structure.re1_right = !mcp2.digitalRead(rotary1_1); 93 | packageData.structure.re1_center = !mcp2.digitalRead(rotary1_5); 94 | } 95 | 96 | void joysticksSetData() { 97 | //Joystick center calibration 98 | adc0 = ads.readADC_SingleEnded(0); 99 | adc1 = ads.readADC_SingleEnded(1); 100 | adc2 = ads.readADC_SingleEnded(2); 101 | adc3 = ads.readADC_SingleEnded(3); 102 | 103 | j1xMiddle = j1xMiddle > 0 ? j1xMiddle : adc0; 104 | j1yMiddle = j1yMiddle > 0 ? j1yMiddle : adc1; 105 | 106 | j2xMiddle = j2xMiddle > 0 ? j2xMiddle : adc2; 107 | j2yMiddle = j2yMiddle > 0 ? j2yMiddle : adc3; 108 | 109 | // Right Joystick 110 | 111 | // Right - Left 112 | adc0_map = map(adc0, 0, joystickMaxValue, 0, 255); 113 | // Top - Bottom 114 | adc1_map = map(adc1, 0, joystickMaxValue, 0, 255); 115 | 116 | // Left Joystick 117 | 118 | // Right - Left 119 | adc2_map = map(adc2, 0, joystickMaxValue, 0, 255); 120 | // Top - Bottom 121 | adc3_map = map(adc3, 0, joystickMaxValue, 0, 255); 122 | 123 | // Left Joystick 124 | packageData.structure.j1x = (adc2 > j1xMiddle + joystickSensitivityValue || adc2 < j1xMiddle - joystickSensitivityValue || adc2 < 0 ) ? adc2_map : 127; // up-down 125 | packageData.structure.j1y = (adc3 > j1yMiddle + joystickSensitivityValue || adc3 < j1yMiddle - joystickSensitivityValue || adc3 < 0 ) ? adc3_map : 127; // left-right 126 | 127 | // Right Joystick 128 | packageData.structure.j2x = (adc0 > j2xMiddle + joystickSensitivityValue || adc0 < j2xMiddle - joystickSensitivityValue || adc0 < 0 ) ? adc0_map : 127; // up-down 129 | packageData.structure.j2y = (adc1 > j2yMiddle + joystickSensitivityValue || adc1 < j2yMiddle - joystickSensitivityValue || adc1 < 0 ) ? adc1_map : 127; // left-right 130 | } 131 | -------------------------------------------------------------------------------- /Remote_TX/util.h: -------------------------------------------------------------------------------- 1 | /** 2 | * util.h 3 | */ 4 | 5 | // Enable the INPUT_PULLUP for the Potentiometers 6 | void potentiometersInit() { 7 | pinMode(POTENTIOMETER_PIN1, INPUT_PULLUP); 8 | pinMode(POTENTIOMETER_PIN2, INPUT_PULLUP); 9 | pinMode(POTENTIOMETER_PIN3, INPUT_PULLUP); 10 | pinMode(POTENTIOMETER_PIN4, INPUT_PULLUP); 11 | pinMode(POTENTIOMETER_PIN5, INPUT_PULLUP); 12 | pinMode(POTENTIOMETER_PIN6, INPUT_PULLUP); 13 | } 14 | 15 | // Enable the INPUT_PULLUP for the MCP1 16 | void mcp1Init() { 17 | mcp1.begin_I2C(MCP23X17_addr1); 18 | 19 | // Switches 20 | mcp1.pinMode(buttonSwitch_1, INPUT_PULLUP); 21 | mcp1.pinMode(buttonSwitch_2, INPUT_PULLUP); 22 | mcp1.pinMode(buttonSwitch_3, INPUT_PULLUP); 23 | mcp1.pinMode(buttonSwitch_4, INPUT_PULLUP); 24 | mcp1.pinMode(buttonSwitch_5, INPUT_PULLUP); 25 | 26 | // Rotary Switch 2 - Buttons 27 | mcp1.pinMode(rotary2_1, INPUT_PULLUP); 28 | mcp1.pinMode(rotary2_2, INPUT_PULLUP); 29 | mcp1.pinMode(rotary2_3, INPUT_PULLUP); 30 | mcp1.pinMode(rotary2_4, INPUT_PULLUP); 31 | mcp1.pinMode(rotary2_5, INPUT_PULLUP); 32 | 33 | // Rotary Switch 2 - Encoder 34 | mcp1.pinMode(rotary2_enc_1, INPUT_PULLUP); 35 | mcp1.pinMode(rotary2_enc_2, INPUT_PULLUP); 36 | 37 | // Ano Rotary Encoder #2 38 | encoder2 = new RotaryEncoder( 39 | mcp1.digitalRead(rotary2_enc_1), 40 | mcp1.digitalRead(rotary2_enc_2), 41 | RotaryEncoder::LatchMode::TWO03, 42 | false, 43 | false 44 | ); 45 | } 46 | 47 | // Enable the INPUT_PULLUP for the MCP2 48 | void mcp2Init() { 49 | mcp2.begin_I2C(MCP23X17_addr2); 50 | 51 | mcp2.pinMode(buttonSwitchPot_1, INPUT_PULLUP); 52 | mcp2.pinMode(buttonSwitchPot_2, INPUT_PULLUP); 53 | mcp2.pinMode(buttonSwitchPot_3, INPUT_PULLUP); 54 | mcp2.pinMode(buttonSwitchPot_4, INPUT_PULLUP); 55 | mcp2.pinMode(buttonSwitchPot_5, INPUT_PULLUP); 56 | mcp2.pinMode(buttonSwitchPot_6, INPUT_PULLUP); 57 | 58 | // Rotary Switch 1 - Buttons 59 | mcp2.pinMode(rotary1_1, INPUT_PULLUP); 60 | mcp2.pinMode(rotary1_2, INPUT_PULLUP); 61 | mcp2.pinMode(rotary1_3, INPUT_PULLUP); 62 | mcp2.pinMode(rotary1_4, INPUT_PULLUP); 63 | mcp2.pinMode(rotary1_5, INPUT_PULLUP); 64 | 65 | // Rotary Switch 1 - Encoder 66 | mcp2.pinMode(rotary1_enc_1, INPUT_PULLUP); 67 | mcp2.pinMode(rotary1_enc_2, INPUT_PULLUP); 68 | 69 | // Ano Rotary Encoder #1 70 | encoder1 = new RotaryEncoder( 71 | mcp2.digitalRead(rotary1_enc_1), 72 | mcp2.digitalRead(rotary1_enc_2), 73 | RotaryEncoder::LatchMode::TWO03, 74 | false, 75 | false 76 | ); 77 | } 78 | 79 | #if defined(ESP8266) || defined(ESP32) 80 | ICACHE_RAM_ATTR 81 | #endif 82 | void setFlag(void) { 83 | // check if the interrupt is enabled 84 | if(!enableInterrupt) { 85 | return; 86 | } 87 | 88 | // we sent a packet, set the flag 89 | transmittedFlag = true; 90 | } 91 | 92 | // sx1280 init 93 | void sx1280Init() { 94 | if(enableSerialPrint) { 95 | Serial.print(F("[SX1280] Initializing ... ")); 96 | } 97 | 98 | int state = radio.beginFLRC(); 99 | 100 | state = radio.setFrequency(frequency); 101 | state = radio.setBitRate(bitRate); 102 | state = radio.setCodingRate(codingRate); 103 | state = radio.setOutputPower(outputPower); 104 | state = radio.setDataShaping(dataShaping); 105 | state = radio.setSyncWord(syncWord, 4); 106 | state = radio.setCRC(crcValue); 107 | 108 | radio.setDio1Action(setFlag); 109 | radio.startTransmit(packageData.byteArray, sizeof(packageData.byteArray)); 110 | 111 | 112 | if(enableSerialPrint) { 113 | if (state == RADIOLIB_ERR_NONE) { 114 | Serial.println(F("success!")); 115 | } else { 116 | Serial.print(F("failed, code ")); 117 | Serial.println(state); 118 | while (true); 119 | } 120 | } 121 | } 122 | 123 | // ads1115 init 124 | void ads1115Init() { 125 | ads.setDataRate(RATE_ADS1115_860SPS); 126 | ads.setGain(GAIN_ONE); 127 | ads.begin(ADS1115_addr1); 128 | } 129 | -------------------------------------------------------------------------------- /STL/1.remote_top.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/1.remote_top.stl -------------------------------------------------------------------------------- /STL/10.RotaryEncoderSpacer.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/10.RotaryEncoderSpacer.stl -------------------------------------------------------------------------------- /STL/11.On_Off_Switches_lock.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/11.On_Off_Switches_lock.stl -------------------------------------------------------------------------------- /STL/12.Potentiometers_Lock.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/12.Potentiometers_Lock.stl -------------------------------------------------------------------------------- /STL/13.Lambda80_Holder_A.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/13.Lambda80_Holder_A.stl -------------------------------------------------------------------------------- /STL/14.Lambda80_Holder_B.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/14.Lambda80_Holder_B.stl -------------------------------------------------------------------------------- /STL/2.remote_middle.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/2.remote_middle.stl -------------------------------------------------------------------------------- /STL/3.remote_bottom.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/3.remote_bottom.stl -------------------------------------------------------------------------------- /STL/4.1.battery_holder_plate.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/4.1.battery_holder_plate.stl -------------------------------------------------------------------------------- /STL/4.2.1.battery_holder_charging_port.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/4.2.1.battery_holder_charging_port.stl -------------------------------------------------------------------------------- /STL/4.2.2.battery_holder_charging_port.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/4.2.2.battery_holder_charging_port.stl -------------------------------------------------------------------------------- /STL/4.3.battery_holder_programming_port.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/4.3.battery_holder_programming_port.stl -------------------------------------------------------------------------------- /STL/4.4.battery_holder_cover.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/4.4.battery_holder_cover.stl -------------------------------------------------------------------------------- /STL/5.MCP23017_Holder.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/5.MCP23017_Holder.stl -------------------------------------------------------------------------------- /STL/6.ScreenHolder_1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/6.ScreenHolder_1.stl -------------------------------------------------------------------------------- /STL/7.ADC+PGA_MPU6050.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/7.ADC+PGA_MPU6050.stl -------------------------------------------------------------------------------- /STL/8.Esp32_Holder_Left.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/8.Esp32_Holder_Left.stl -------------------------------------------------------------------------------- /STL/9.Esp32_Holder_Right.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/9.Esp32_Holder_Right.stl -------------------------------------------------------------------------------- /STL/A.model_top_middle_bottom.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/A.model_top_middle_bottom.stl -------------------------------------------------------------------------------- /STL/B.model_with_connectors.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroKnotDevelopment/ESP32-Transmitter/5466ad4a93dd0faea77805f786afb02c03472b22/STL/B.model_with_connectors.stl --------------------------------------------------------------------------------