//================== Example7_4 ====================
#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 12
#define pinDirection2 13
void setup() {
    Serial.begin(115200);
    initOled();
    pinMode(pinDirection1, OUTPUT);
    pinMode(pinDirection2, OUTPUT);
    functionsForPrintingAmessage(15,5,"DC MOTOR");
  }
void loop() {
  while (Serial.available()==0);
  byte valDc= Serial.read();
  if(valDc=='1'){
     digitalWrite(pinDirection1,1);
     digitalWrite(pinDirection2,0);
     functionsForPrintingAmessage(25,35,"MOTOR L");
    }
  else if(valDc=='2'){
     digitalWrite(pinDirection1,0);
     digitalWrite(pinDirection2,1);
     functionsForPrintingAmessage(25,35,"MOTOR R");
    }
  else{
     digitalWrite(pinDirection1,0);
     digitalWrite(pinDirection2,0);
     functionsForPrintingAmessage(25,35,"MOTOR S");
    }
}
//=================================================


