Thank you for answering,
I linked it as it explains the . pdf
GND -> GND
5V -> Vin
Pin13 -> Clk
Pin11 -> DI
Pin10 -> CS
and this is the code I use
#include <Adafruit_GFX.h>
#include <Adafruit_SharpMem.h>
#define SHARP_SCK 13
#define SHARP_MOSI 11
#define SHARP_SS 10
#define SCREEN_WIDTH 400
#define SCREEN_HEIGHT 240
Adafruit_SharpMem display(SHARP_SCK, SHARP_MOSI, SHARP_SS, SCREEN_WIDTH, SCREEN_HEIGHT);
#define BLACK 0
#define WHITE 1
void setup(void)
{
Serial.begin(9600);
Serial.println("Hello!");
// start & clear the display
display.begin();
display.clearDisplay();
}
void loop(void)
{
// Clean for start to Draw
display.clearDisplay();
drawText("Texto de prueba", 4, 18);
drawNumber(123.567f, 4, 30);
for(int j = 1; j <= 5; j++){
drawBattery_1(j/5.0f);
for(int i = 20*(j-1); i < (j*20); i++){
drawBar(i);
display.refresh();
delay(50);
}
}
// Clean
display.refresh();
}
void drawBar(float v){
int16_t x = 20, y = 80, w = 100, h = 12;
// Draw Bar
display.drawRect(x, y, w, h, BLACK);
// Draw Charge
if(v <= w){
display.fillRect(x, y, v, h, BLACK);
}
}
void drawNumber(float n, int x, int y){
display.setTextSize(1);
display.setTextColor(BLACK);
display.setCursor(x, y);
display.println(n);
}
void drawText(const char* txt, int x, int y){
display.setTextSize(1);
display.setTextColor(BLACK);
display.setCursor(x,y);
display.println(txt);
}
void drawBattery_1(float charge){
int16_t x = 1, y = 1, w = 30, h = 12;
int16_t polo_w = 2, polo_h = 4;
// Draw Battery
display.drawRect(x, y, w, h, BLACK);
display.fillRect(x + w, y + polo_h, polo_w, polo_h, BLACK);
// Draw Charge
display.fillRect(x, y, w * charge, h, BLACK);
}
but this is the result, I can not color 2/3 of the screen: