max90727 / RA8835_Arduino-Uno

0 stars 3 forks source link

S1D13700 #1

Open uXeBoy opened 9 years ago

uXeBoy commented 9 years ago

Thank you for this library! Just wanted to let you know that I was having a lot of strange buggy behaviour using the library with a S1D13700 controller, and was pulling my hair out trying to find the solution, which eventually turned out to be as simple as changing the toggling of the A0 pin in the WriteCommand / WriteData routines like so:

void SED1335::GLCD_WriteCommand(byte command) {
    GLCD_CTRL_PORT |= (1 << SED1335_A0);    
    GLCD_DATA_PORT1 &= ~GLCD_DATA_MASK1;
    GLCD_DATA_PORT1 |= (command GLCD_DATA_SHIFT1);
    GLCD_DATA_PORT2 &= ~GLCD_DATA_MASK2;
    GLCD_DATA_PORT2 |= (command GLCD_DATA_SHIFT2);
    GLCD_CTRL_PORT &= ~((1 << SED1335_CS) | (1 << SED1335_WR));
    n_delay();
    GLCD_CTRL_PORT |= ((1 << SED1335_WR) | (1 << SED1335_CS));

}
void SED1335::GLCD_WriteData(byte data) {
    GLCD_CTRL_PORT &= ~(1 << SED1335_A0);
    GLCD_DATA_PORT1 &= ~GLCD_DATA_MASK1;
    GLCD_DATA_PORT1 |= (data GLCD_DATA_SHIFT1);
    GLCD_DATA_PORT2 &= ~GLCD_DATA_MASK2;
    GLCD_DATA_PORT2 |= (data GLCD_DATA_SHIFT2);
    GLCD_CTRL_PORT &= ~((1 << SED1335_CS) | (1 << SED1335_WR));
    n_delay();
    GLCD_CTRL_PORT |= ((1 << SED1335_WR) | (1 << SED1335_CS));
}
amahlaka commented 8 years ago

can you show your code as well, im trying to make my own but i havew no idea how to get the proper syntax