| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/LCDWIKI_SPI}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/LCDWIKI_SPI}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/ezButton/src}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/ezButton/src}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/RotaryEncoder/src}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/RotaryEncoder/src}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/Adafruit_GFX_Library}""/> | |||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/U8g2_for_Adafruit_GFX/src}""/> | |||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/SSD1283A/src}""/> | |||||
| </option> | </option> | ||||
| <inputType id="io.sloeber.compiler.cpp.sketch.input.543353444" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/> | <inputType id="io.sloeber.compiler.cpp.sketch.input.543353444" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/> | ||||
| </tool> | </tool> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/LCDWIKI_SPI}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/LCDWIKI_SPI}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/ezButton/src}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/ezButton/src}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/RotaryEncoder/src}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/RotaryEncoder/src}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/Adafruit_GFX_Library}""/> | |||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/U8g2_for_Adafruit_GFX/src}""/> | |||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/SSD1283A/src}""/> | |||||
| </option> | </option> | ||||
| <inputType id="io.sloeber.compiler.c.sketch.input.1984508786" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/> | <inputType id="io.sloeber.compiler.c.sketch.input.1984508786" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/> | ||||
| </tool> | </tool> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/LCDWIKI_SPI}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/LCDWIKI_SPI}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/ezButton/src}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/ezButton/src}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/RotaryEncoder/src}""/> | <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/RotaryEncoder/src}""/> | ||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/Adafruit_GFX_Library}""/> | |||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/U8g2_for_Adafruit_GFX/src}""/> | |||||
| <listOptionValue builtIn="false" value=""${workspace_loc:/EchoLot/libraries/SSD1283A/src}""/> | |||||
| </option> | </option> | ||||
| <inputType id="io.sloeber.compiler.S.sketch.input.2093386672" name="Assembly source files" superClass="io.sloeber.compiler.S.sketch.input"/> | <inputType id="io.sloeber.compiler.S.sketch.input.2093386672" name="Assembly source files" superClass="io.sloeber.compiler.S.sketch.input"/> | ||||
| </tool> | </tool> |
| <type>2</type> | <type>2</type> | ||||
| <location>C:/Users/FSmilari/Documents/Arduino/libraries/Adafruit_BusIO</location> | <location>C:/Users/FSmilari/Documents/Arduino/libraries/Adafruit_BusIO</location> | ||||
| </link> | </link> | ||||
| <link> | |||||
| <name>libraries/Adafruit_GFX_Library</name> | |||||
| <type>2</type> | |||||
| <location>C:/Users/FSmilari/Documents/Arduino/libraries/Adafruit_GFX_Library</location> | |||||
| </link> | |||||
| <link> | <link> | ||||
| <name>libraries/LCDWIKI_GUI</name> | <name>libraries/LCDWIKI_GUI</name> | ||||
| <type>2</type> | <type>2</type> | ||||
| <type>2</type> | <type>2</type> | ||||
| <locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.8.4/libraries/SPI</locationURI> | <locationURI>ECLIPSE_HOME/arduinoPlugin/packages/arduino/hardware/avr/1.8.4/libraries/SPI</locationURI> | ||||
| </link> | </link> | ||||
| <link> | |||||
| <name>libraries/SSD1283A</name> | |||||
| <type>2</type> | |||||
| <location>C:/Users/FSmilari/Documents/Arduino/libraries/SSD1283A</location> | |||||
| </link> | |||||
| <link> | |||||
| <name>libraries/U8g2_for_Adafruit_GFX</name> | |||||
| <type>2</type> | |||||
| <locationURI>ECLIPSE_HOME/arduinoPlugin/libraries/U8g2_for_Adafruit_GFX/1.8.0</locationURI> | |||||
| </link> | |||||
| <link> | <link> | ||||
| <name>libraries/Wire</name> | <name>libraries/Wire</name> | ||||
| <type>2</type> | <type>2</type> |
| #include "Arduino.h" | #include "Arduino.h" | ||||
| #include <LCDWIKI_GUI.h> // core graphics library | #include <LCDWIKI_GUI.h> // core graphics library | ||||
| #include <LCDWIKI_SPI.h> // hardware-specific library | |||||
| //#include <LCDWIKI_SPI.h> // hardware-specific library | |||||
| #include <SSD1283A.h> | |||||
| #include "RotaryControler.h" | #include "RotaryControler.h" | ||||
| //#include <U8g2_for_Adafruit_GFX.h> | |||||
| #include <Fonts/FreeMonoOblique9pt7b.h> | |||||
| const int trigPin = 12; | const int trigPin = 12; | ||||
| const int echoPin = 10; | const int echoPin = 10; | ||||
| #define GREEN 0x07E0 | #define GREEN 0x07E0 | ||||
| #define WHITE 0xFFFF | #define WHITE 0xFFFF | ||||
| #define MODEL SSD1283A | |||||
| //#define MODEL SSD1283A | |||||
| #define LED -1 // to +5v | #define LED -1 // to +5v | ||||
| #define SCK 13//A1 with SCK on 13 and SDA on 11 it is 10x faster!!! | #define SCK 13//A1 with SCK on 13 and SDA on 11 it is 10x faster!!! | ||||
| #define SDA 11//A2 | #define SDA 11//A2 | ||||
| String lastDistance = ""; | String lastDistance = ""; | ||||
| LCDWIKI_SPI mylcd(MODEL, CS, CD, MISO, MOSI, RST, SCK, LED); //software spi,model,cs,cd,miso,mosi,reset,clk,led | |||||
| SSD1283A mylcd( CS, CD, RST, LED); //software spi,model,cs,cd,miso,mosi,reset,clk,led | |||||
| //U8G2_FOR_ADAFRUIT_GFX u8g2_gfx; | |||||
| RotaryControler RotaryControler(RotEnc_Dta_Pin, RotEnc_Clk_Pin, RotEnc_Switch_Pin); | RotaryControler RotaryControler(RotEnc_Dta_Pin, RotEnc_Clk_Pin, RotEnc_Switch_Pin); | ||||
| ExEzButton MeasureBtn(Measure_Pin, false, 2000); | ExEzButton MeasureBtn(Measure_Pin, false, 2000); | ||||
| pinMode(trigPin, OUTPUT); | pinMode(trigPin, OUTPUT); | ||||
| pinMode(echoPin, INPUT); | pinMode(echoPin, INPUT); | ||||
| mylcd.Init_LCD(); | |||||
| mylcd.Fill_Screen(BLACK); | |||||
| // u8g2_gfx.begin(mylcd); | |||||
| mylcd.init(); | |||||
| mylcd.fillScreen(BLACK); | |||||
| mylcd.setFont(&FreeMonoOblique9pt7b); | |||||
| pinMode(Measure_Pin, INPUT); | pinMode(Measure_Pin, INPUT); | ||||
| pinMode(RotEnc_Switch_Pin, INPUT); | pinMode(RotEnc_Switch_Pin, INPUT); | ||||
| MeasureBtn.loop(); | MeasureBtn.loop(); | ||||
| RotaryControler.loop(); | RotaryControler.loop(); | ||||
| mylcd.Set_Text_Mode(1); | |||||
| mylcd.Set_Text_colour(WHITE); | |||||
| mylcd.Set_Text_Back_colour(RED); | |||||
| mylcd.Set_Text_Size(2); | |||||
| // mylcd.Set_Text_Mode(1); | |||||
| mylcd.setTextColor(WHITE); | |||||
| // mylcd.Set_Text_Back_colour(RED); | |||||
| mylcd.setTextSize(1); | |||||
| if (RotaryControler.isSwitchPressed()) { | if (RotaryControler.isSwitchPressed()) { | ||||
| Serial.println("RotaryEnc SwitchPressed"); | Serial.println("RotaryEnc SwitchPressed"); | ||||
| // Serial.println(duration); | // Serial.println(duration); | ||||
| // Serial.print("Distance:"); | // Serial.print("Distance:"); | ||||
| // Serial.println(distance); | |||||
| Serial.println(distance); | |||||
| char buf[50]; | char buf[50]; | ||||
| sprintf(buf, "%lu cm", distance); | sprintf(buf, "%lu cm", distance); | ||||
| if (!lastDistance.equals(buf)) { | |||||
| mylcd.Fill_Rect(0, 48, 130, 20, RED); | |||||
| mylcd.Print_String(buf, 30, 50); | |||||
| delay(100); | |||||
| lastDistance = buf; | |||||
| } | |||||
| // if (!lastDistance.equals(buf)) { | |||||
| mylcd.fillRect(0, 48, 130, 20, RED); | |||||
| // char *s = &String(buf)[0]; | |||||
| // int16_t w = 0, h = 0; | |||||
| // u8g2_gfx.setFont(u8g2_font_helvB12_tf); | |||||
| // w = u8g2_gfx.getUTF8Width(s); | |||||
| // h = u8g2_gfx.getFontAscent() - u8g2_gfx.getFontDescent(); | |||||
| // u8g2_gfx.setForegroundColor(WHITE); | |||||
| // u8g2_gfx.setCursor(30, 50); | |||||
| // mylcd.println(s); | |||||
| mylcd.setTextColor(WHITE); | |||||
| mylcd.setCursor(30, 50); | |||||
| mylcd.println(buf); | |||||
| delay(100); | |||||
| // lastDistance = buf; | |||||
| // } | |||||
| delay(200); | delay(200); | ||||
| } else { | } else { | ||||
| mylcd.Fill_Screen(BLACK); | |||||
| mylcd.fillScreen(BLACK); | |||||
| } | } | ||||
| } | } |
| //This is a automatic generated file | //This is a automatic generated file | ||||
| //Please do not modify this file | //Please do not modify this file | ||||
| //If you touch this file your change will be overwritten during the next build | //If you touch this file your change will be overwritten during the next build | ||||
| //This file has been generated on 2025-12-21 14:22:01 | |||||
| //This file has been generated on 2025-12-21 21:41:05 | |||||
| #include "Arduino.h" | #include "Arduino.h" | ||||
| #include "Arduino.h" | #include "Arduino.h" | ||||
| #include <LCDWIKI_GUI.h> | #include <LCDWIKI_GUI.h> | ||||
| #include <LCDWIKI_SPI.h> | |||||
| #include <SSD1283A.h> | |||||
| #include "RotaryControler.h" | #include "RotaryControler.h" | ||||
| #include <Fonts/FreeMonoOblique9pt7b.h> | |||||
| void setup() ; | void setup() ; | ||||
| void loop() ; | void loop() ; |