//================== Example7_5 ====================
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
#define i2c_Address 0x3c 
#define SCREEN_WIDTH 128 
#define SCREEN_HEIGHT 64 
#define OLED_RESET -1   
Adafruit_SH1106G display = Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT,&Wire, OLED_RESET);

#define pinDirection1 4
#define pinMotor1 25



void setup() {
    Serial.begin(115200);
    initOled();
    pinMode(pinDirection1, OUTPUT);
    functionsForPrintingAmessage(15,5,"DC MOTOR");
  }
void loop() {
   static int valSpeed=0;
    if(Serial.available()>0){
       byte valFromUart= Serial.read();
       if(valFromUart == '+'){
         if(valSpeed!=250)
            valSpeed=valSpeed+25;
       }
        if(valFromUart == '-'){
         if(valSpeed!=-250)
            valSpeed=valSpeed-25;
       }
       if(valFromUart != '-' && valFromUart != '+' )
          valSpeed=0;
       motor(valSpeed);
       functionsForPrintingData(50,40,valSpeed);
    }

}
   
//=================================================
