|
@@ -0,0 +1,83 @@
|
|
|
|
|
+
|
|
|
|
|
+#include "__main_struct.h" //lite #include "___main/__main_struct.h"
|
|
|
|
|
+
|
|
|
|
|
+#include "progmem.h"
|
|
|
|
|
+
|
|
|
|
|
+#include "__main_struct_limits.h"
|
|
|
|
|
+#include "_PortTypes_struct.h"
|
|
|
|
|
+#include "_Port_Exp_state_ttl_struct.h"
|
|
|
|
|
+#include "_Port_Broadcast_state_struct.h"
|
|
|
|
|
+#include "_PortStates_struct.h"
|
|
|
|
|
+#include "_Port_I2C_driver_struct.h"
|
|
|
|
|
+#include "config_Active_ControllerID.h"
|
|
|
|
|
+#include "config_Slave_Ports_LOCAL_config.h" //lite
|
|
|
|
|
+
|
|
|
|
|
+#include "automation_driven.submodule.struct.write_neuron_override.h"
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+#include "_TASK_TYPES_struct.h"
|
|
|
|
|
+
|
|
|
|
|
+#include "_time_struct.h"
|
|
|
|
|
+
|
|
|
|
|
+#include "TASK_TYPE_T_Get_Ports_Status_INPUT_A___.h"
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+#include "_Slave_Ports_Status_func_add_lite.h"
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+#if Active_ControllerID == 0x14
|
|
|
|
|
+ #include "0x14/config_Slave_Ports_LOCAL_0x14_init.h"
|
|
|
|
|
+#elif Active_ControllerID == 0x35
|
|
|
|
|
+ #include "0x35/config_Slave_Ports_neuron_LOCAL_0x35_init.h"
|
|
|
|
|
+#elif Active_ControllerID == 0x38
|
|
|
|
|
+ #include "0x38/config_Slave_Ports_LOCAL_0x38_init.h"
|
|
|
|
|
+ #elif Active_ControllerID == 0x43
|
|
|
|
|
+ #include "0x43/config_Slave_Ports_LOCAL_0x43_init.h"
|
|
|
|
|
+#else
|
|
|
|
|
+ #error not set correct Active_ControllerID
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+#if defined(HAS_Adafruit_ST7789)
|
|
|
|
|
+ #include <Adafruit_GFX.h> // Core graphics library
|
|
|
|
|
+ #include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
|
|
|
|
|
+ #include <SPI.h>
|
|
|
|
|
+ // Initialize Adafruit ST7789 TFT library
|
|
|
|
|
+ // Adafruit_ST7789 DISPLAY_DEV = Adafruit_ST7789(ST7789_CS, ST7789_DC, ST7789_RST);
|
|
|
|
|
+ Adafruit_ST7789 DISPLAY_DEV = Adafruit_ST7789(0, ST7789_DC, ST7789_RST);
|
|
|
|
|
+
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+void setup() {
|
|
|
|
|
+ // initialize digital pin ledPin as an output.
|
|
|
|
|
+ TASK_TYPE_T_Get_Ports_Status_INPUT_A___SETUP();
|
|
|
|
|
+ #if defined(HAS_Adafruit_ST7789)
|
|
|
|
|
+
|
|
|
|
|
+ DISPLAY_DEV.init(240, 240, SPI_MODE2); // Init ST7789 display 240x240 pixel
|
|
|
|
|
+ //DISPLAY_DEV.setRotation(2);
|
|
|
|
|
+ DISPLAY_DEV.fillScreen(ST77XX_BLACK);
|
|
|
|
|
+ DISPLAY_DEV.setCursor(0, 0);
|
|
|
|
|
+ DISPLAY_DEV.setTextColor(WHITE);
|
|
|
|
|
+ DISPLAY_DEV.setTextWrap(true);
|
|
|
|
|
+ DISPLAY_DEV.print(F("P5 ST7789 Voltage"));
|
|
|
|
|
+
|
|
|
|
|
+ #endif
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// the loop function runs over and over again forever
|
|
|
|
|
+void loop() {
|
|
|
|
|
+ //digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
|
|
|
|
|
+ delay(1000); // wait for a second
|
|
|
|
|
+ DISPLAY_DEV.setTextSize(4);
|
|
|
|
|
+ DISPLAY_DEV.drawRect(0, 20, DISPLAY_DEV.width(), 100, MAGENTA);
|
|
|
|
|
+ DISPLAY_DEV.setCursor(0, 40);
|
|
|
|
|
+
|
|
|
|
|
+ DISPLAY_DEV.print(analogRead(A0));
|
|
|
|
|
+ DISPLAY_DEV.setCursor(0, 60);
|
|
|
|
|
+ DISPLAY_DEV.print(analogRead(A1));
|
|
|
|
|
+}
|