|
@@ -1,3 +1,10 @@
|
|
|
|
|
+
|
|
|
|
|
+#include <Arduino.h>
|
|
|
|
|
+#include <U8g2lib.h>
|
|
|
|
|
+
|
|
|
|
|
+#define P5__DISPLAY__DISABLE
|
|
|
|
|
+#define P5__DEBUG
|
|
|
|
|
+
|
|
|
#define Active_ControllerID 0x20
|
|
#define Active_ControllerID 0x20
|
|
|
|
|
|
|
|
//#include <StandardCplusplus.h>
|
|
//#include <StandardCplusplus.h>
|
|
@@ -8,13 +15,15 @@
|
|
|
#include "___P5_LIB/p5__display.h"
|
|
#include "___P5_LIB/p5__display.h"
|
|
|
|
|
|
|
|
#include "___P5_LIB/p5__router.h"
|
|
#include "___P5_LIB/p5__router.h"
|
|
|
|
|
+#include "___CONFIG/pins.h"
|
|
|
|
|
+ #include "___P5_LIB/p5__pins__setup.h"
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+#include "___P5_LIB/p5__task___attr.h"
|
|
|
|
|
|
|
|
#include "___P5_LIB/p5__intro.h"
|
|
#include "___P5_LIB/p5__intro.h"
|
|
|
#include "___P5_LIB/p5__pwm.h"
|
|
#include "___P5_LIB/p5__pwm.h"
|
|
|
#include "___P5_LIB/p5__swing.h"
|
|
#include "___P5_LIB/p5__swing.h"
|
|
|
-#include "___P5_LIB/p5__pins__setup.h"
|
|
|
|
|
|
|
+//#include "___P5_LIB/p5__pins__setup.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "___P5_LIB/p5__task.h"
|
|
#include "___P5_LIB/p5__task.h"
|
|
@@ -42,14 +51,16 @@ U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0);
|
|
|
//char *text ;
|
|
//char *text ;
|
|
|
//const char *text = "U8g2 ";
|
|
//const char *text = "U8g2 ";
|
|
|
//AA U8G2LOG u8g2log;
|
|
//AA U8G2LOG u8g2log;
|
|
|
|
|
+U8G2LOG u8g2log;
|
|
|
|
|
|
|
|
-#define U8LOG_WIDTH_D 32
|
|
|
|
|
-uint8_t U8LOG_WIDTH = U8LOG_WIDTH_D ;
|
|
|
|
|
|
|
+#define U8LOG_WIDTH 32 // 15 //32
|
|
|
|
|
+//uint8_t U8LOG_WIDTH = U8LOG_WIDTH_D ;
|
|
|
|
|
+
|
|
|
|
|
+#define U8LOG_HEIGHT 10 // 4 //10
|
|
|
|
|
+//uint8_t U8LOG_HEIGHT = U8LOG_HEIGHT_D ;
|
|
|
|
|
+//uint8_t u8log_buffer[U8LOG_WIDTH_D*U8LOG_HEIGHT_D];
|
|
|
|
|
+uint8_t u8log_buffer[U8LOG_WIDTH*U8LOG_HEIGHT];
|
|
|
|
|
|
|
|
-#define U8LOG_HEIGHT_D 5 //10
|
|
|
|
|
-uint8_t U8LOG_HEIGHT = U8LOG_HEIGHT_D ;
|
|
|
|
|
-uint8_t u8log_buffer[U8LOG_WIDTH_D*U8LOG_HEIGHT_D];
|
|
|
|
|
-U8G2LOG u8g2log;
|
|
|
|
|
|
|
|
|
|
//p5__display__class p5__display__class_A(u8g2,U8LOG_WIDTH, U8LOG_HEIGHT , u8log_buffer ) ;
|
|
//p5__display__class p5__display__class_A(u8g2,U8LOG_WIDTH, U8LOG_HEIGHT , u8log_buffer ) ;
|
|
|
//p5__display__class p5__display__class_A ;
|
|
//p5__display__class p5__display__class_A ;
|
|
@@ -57,11 +68,12 @@ U8G2LOG u8g2log;
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+ P5__STATUS_T P5__STATUS_A = P5__STATUS__INIT;
|
|
|
|
|
|
|
|
|
|
|
|
|
void setup(void) {
|
|
void setup(void) {
|
|
|
Serial.begin(115200);
|
|
Serial.begin(115200);
|
|
|
- Serial.println(" ST ");
|
|
|
|
|
|
|
+ Serial.println("SX");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -95,51 +107,84 @@ U8G2LOG u8g2log;
|
|
|
//p5__display__class_A.begin(u8g2,U8LOG_WIDTH, U8LOG_HEIGHT , u8log_buffer ) ;
|
|
//p5__display__class_A.begin(u8g2,U8LOG_WIDTH, U8LOG_HEIGHT , u8log_buffer ) ;
|
|
|
u8g2.begin();
|
|
u8g2.begin();
|
|
|
|
|
|
|
|
- u8g2.setFont(u8g2_font_amstrad_cpc_extended_8f//u8g2_font_tom_thumb_4x6_mf); // set the font for the terminal window
|
|
|
|
|
|
|
+ u8g2.setFont(u8g2_font_tom_thumb_4x6_mf //u8g2_font_amstrad_cpc_extended_8f//u8g2_font_tom_thumb_4x6_mf); // set the font for the terminal window
|
|
|
);
|
|
);
|
|
|
u8g2log.begin(u8g2, U8LOG_WIDTH, U8LOG_HEIGHT, u8log_buffer);
|
|
u8g2log.begin(u8g2, U8LOG_WIDTH, U8LOG_HEIGHT, u8log_buffer);
|
|
|
u8g2log.setLineHeightOffset(0); // set extra space between lines in pixel, this can be negative
|
|
u8g2log.setLineHeightOffset(0); // set extra space between lines in pixel, this can be negative
|
|
|
u8g2log.setRedrawMode(0); // 0: Update screen with newline, 1: Update screen for every char
|
|
u8g2log.setRedrawMode(0); // 0: Update screen with newline, 1: Update screen for every char
|
|
|
- Serial.println(" SB ");
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // u8g2log.print("\f TEST55 \n");
|
|
|
|
|
+ Serial.print(" SB ");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ #if defined(P5__DISPLAY__DISABLE)
|
|
|
|
|
+ u8g2log.print("\f 5__DISPLAY__DISABLE \n");
|
|
|
|
|
+ #else
|
|
|
|
|
+ #endif
|
|
|
|
|
+ // p5__display__log__beg(u8g2log);
|
|
|
|
|
+ // u8g2log.print(" SB ");
|
|
|
|
|
+
|
|
|
|
|
+ // p5__display__log__last(u8g2log,1);
|
|
|
|
|
+
|
|
|
|
|
+ delay(2000);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- P5__STATUS_T P5__STATUS_A = P5__STATUS__INIT;
|
|
|
|
|
|
|
|
|
|
- // p5__pins__setup(p5__display__class_A , P5__STATUS_A);
|
|
|
|
|
- //p5__pins__setup();
|
|
|
|
|
|
|
+ // p5__pins__setup();
|
|
|
// p5__router()
|
|
// p5__router()
|
|
|
-
|
|
|
|
|
- // p5__config__individual__init(P5__TASK__CONFIG_A);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ Serial.println("22");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ p5__pins__setup( P5__STATUS_A);
|
|
|
|
|
+ Serial.print("33");
|
|
|
|
|
+ p5__config__individual__init(P5__TASK__CONFIG_A);
|
|
|
|
|
+ Serial.print("44");
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long t = 0;
|
|
unsigned long t = 0;
|
|
|
|
|
+unsigned long t_timestamp = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
void loop(void) {
|
|
void loop(void) {
|
|
|
|
|
|
|
|
-// #include "___P5_LIB/p5__task__loop.h"
|
|
|
|
|
|
|
+ #include "___P5_LIB/p5__task__loop.h"
|
|
|
|
|
|
|
|
// delay(100);
|
|
// delay(100);
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( t < millis() ) {
|
|
if ( t < millis() ) {
|
|
|
- t = millis() + 15000; // every 15 seconds
|
|
|
|
|
|
|
+ t = millis() + 300000; // every 15 seconds
|
|
|
// p5__display__print(u8g2,u8g2log, "\f"); // \f = form feed: clear the screen
|
|
// p5__display__print(u8g2,u8g2log, "\f"); // \f = form feed: clear the screen
|
|
|
u8g2log.print("\f");
|
|
u8g2log.print("\f");
|
|
|
}
|
|
}
|
|
|
- p5__display__print(u8g2,u8g2log,"t[");
|
|
|
|
|
- // p5__display__print(u8g2,u8g2log,millis());
|
|
|
|
|
- // p5__display__print(u8g2,u8g2log,"\n");
|
|
|
|
|
- u8g2log.print(millis()); //todo type class; p5__display__print(u8g2,u8g2log,millis());
|
|
|
|
|
- u8g2log.print(u8g2,u8g2log,"\n"); //todo class type \n
|
|
|
|
|
|
|
|
|
|
- delay(500);
|
|
|
|
|
- Serial.println(" L");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if ( t_timestamp < millis() ) {
|
|
|
|
|
+ t_timestamp = millis() + 10000; // every 15 seconds
|
|
|
|
|
+ // p5__display__print(u8g2,u8g2log, "\f"); // \f = form feed: clear the screen
|
|
|
|
|
+ // u8g2log.print("t2[");
|
|
|
|
|
+ // u8g2log.print(millis()); //todo type class; p5__display__print(u8g2,u8g2log,millis());
|
|
|
|
|
+ // u8g2log.print("]\n"); //todo class type \n
|
|
|
|
|
+ Serial.println(" Ti");
|
|
|
|
|
+
|
|
|
|
|
+ u8g2log.print(" Ti ");
|
|
|
|
|
+ #if defined(P5__DISPLAY__DISABLE)
|
|
|
|
|
+ #else
|
|
|
|
|
+ p5__display__log__beg(u8g2log);
|
|
|
|
|
+ #endif
|
|
|
|
|
+
|
|
|
|
|
+ u8g2log.print(millis());
|
|
|
|
|
+ p5__display__log__last(u8g2log,0);
|
|
|
|
|
+ u8g2log.print("\n");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ delay(50);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|