Grubits Gábor
Published © GPL3+

Konica Minolta MFP Touch screen use with Arduino Uno

How to reuse wrong Konica Minolta MFP display touch panel.

IntermediateShowcase (no instructions)2,730
Konica Minolta MFP Touch screen use with Arduino Uno

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
1.44" Colorful SPI TFT LCD Display ST7735 128X128 Replace Nokia 5110/3310 LCD
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Resistor 10k ohm
Resistor 10k ohm
×5
Original New Touch Screen for Konica Minolta Bizhub C224 C284 C364 C554 C654 C754 control Panel
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

File missing, please reupload.

Schematic

Code

Source Code

Arduino
#include <Wire.h>               //Connect Konica Minolta touch screen SDA to A04 and SCK to A05
#include <Adafruit_GFX.h>       //Core graphics library
#include <Adafruit_ST7735.h>    //Hardware-specific library
#include <SPI.h>
 
#define TFT_SCLK 13
#define TFT_MOSI 11
#define TFT_CS 10
#define TFT_RST 9
#define TFT_DC 8
 
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
 
byte register1;
byte register2;
byte register3;
byte register4;
byte register5;
byte register6;
byte register7;
byte register8;
byte register9;
byte register10;
byte register11;
 
int xx1, xx2, yy1, yy2, r, x, y; //variables
 
void setup() {
  tft.initR(INITR_REDTAB);    //initialize a ST7735S chip, black tab
  tft.fillScreen(ST7735_BLACK); //clear screen
  Wire.begin(0x5c);           //join i2c bus (address optional for master)
  //Serial.begin(115200);     //start serial for output
  //Serial.println("starting"); //print "starting" to serial
}
 
void loop() {
  Wire.beginTransmission(0x5C); //touch panel address
  Wire.write(0x00);       //start register
  Wire.endTransmission();     //communication close
  Wire.requestFrom(0x5c, 11);   //how many byte to read from address 0x5C
 
  register1 = Wire.read();    //first byte reading (Touch counter)
  register2 = Wire.read();    //second reading (????)
  register3 = Wire.read();    //etc etc etc (first finger X coordinate low byte)
  register4 = Wire.read();    //first finger X coordinate high byte
  register5 = Wire.read();    //first finger Y coordinate low byte
  register6 = Wire.read();    //first finger Y coordinate high byte
  register7 = Wire.read();    //??
  register8 = Wire.read();    //second finger X coordinate low byte
  register9 = Wire.read();    //second finger X coordinate high byte
  register10 = Wire.read();   //second finger Y coordinate low byte
  register11 = Wire.read();   //second finger Y coordinate high byte
 
 
  xx1 = (register4 * 256) + register3;    //calculate 2 byte to touch coordinate (0-1024)
  yy1 = (register6 * 256) + register5;    //calculate 2 byte to touch coordinate (0-600)
  xx2 = (register9 * 256) + register8;    //calculate 2 byte to touch coordinate (0-1024)
  yy2 = (register11 * 256) + register10;  //calculate 2 byte to touch coordinate (0-600)
 
  xx1 = xx1 / 8;              //divide by 8 to scale 128x128
  xx1 = 128 - xx1;
 
  yy1 = yy1 / 4.6875;         //divide by 4.6 to scale 128x128
  yy1 = 128 - yy1;
 
  xx2 = xx2 / 8;
  xx2 = 128 - xx2;
 
  yy2 = yy2 / 4, 6875;
  yy2 = 128 - yy2;
 
  //x= xx1 - xx2;             //calculate radius
  //y= yy2 - yy2;
 
  //x= x*x;                   //pythagoras
  //y= y*y;
  //r = x +y;
  //r= sqrt(r);
 
  //Serial.print("Touch counter:");
  //Serial.println(register1);
  //Serial.print("First finger horinzontal (X) coordinate:");
  //Serial.println(xx1);
 
  //Serial.print("First finger vertical (Y) coordinate:");
  //Serial.println(yy1);
 
  //Serial.print("Second finger horinzontal (X) coordinate:");
  //Serial.println(xx2);
 
  //Serial.print("Second finger vertical (Y) coordinate:");
  //Serial.println(yy2);
 
  tft.drawPixel(xx1, yy1, ST7735_WHITE);  //write dots to screen first finger
 
  tft.drawPixel(xx2, yy2, ST7735_GREEN);  //write dots to screen second finger
 
  //Draw line between two finger
  //tft.drawLine(xx1,yy1,xx2,yy2, ST7735_WHITE); // test
 
  //Draw dot for first finger and draw circle with radius between first and second finger disatance
  //if (register1 <= 1) {             //test
  //  tft.drawPixel(xx1, yy1, ST7735_WHITE);    //test
  //}                       //test
  //else {tft.drawCircle (xx1,yy1,r,ST7735_BLUE); //test
  //}                       //test
  //delay(100);                   //test

    }

Credits

Grubits Gábor
2 projects • 7 followers

Comments