Pages: [1]   Go Down
Author Topic: 4dsystems serial OLED display using Newsoftserial?  (Read 1399 times)
0 Members and 1 Guest are viewing this topic.
Nova Scotia
Offline Offline
Full Member
***
Karma: 4
Posts: 186
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was just wondering if anyone has a 4dsystems oled display working with the newsoftserial yet? Rightnow the only only way I can use the display and still program the arduino is to use the Mega because of the multiple serial ports.

Mike
Logged

Spain
Offline Offline
Full Member
***
Karma: 0
Posts: 149
LED
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using a 4d LCD display with SoftwareSerial (Arduino 1.0).
Logged

Arduino Uno (R2fix) / Duemilanove (328p)
Ethernet Shield SD (v5)

Nova Scotia
Offline Offline
Full Member
***
Karma: 4
Posts: 186
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have not installed Arduino 1.0 yet. Just waiting until all the bugs are worked out. Was it difficult converting your old code over to use the newsoftserial ?
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I originally wrote my 4dSys library using exclusively NewSoftSerial, only changed it to work with both soft and hardware serial after it was "complete".  You shouldn't see any difference between using hardware or software serial for working with the 4D screens, only thing I found was needing to increase the default buffer size when block reading from the SD card.  Just make sure you're using the latest (beta) version, which should be the same as the one that will replace the old SoftwareSerial library in 1.0.
Logged

Nova Scotia
Offline Offline
Full Member
***
Karma: 4
Posts: 186
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have any of your code available that I could build off of?
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My library is available here
http://arduino.cc/forum/index.php/topic,64234.0.html

And avenue33 has written a library for the more advanced 4D controller in their touch screens.  The commands are all the same as for the small OLED screens, but some of the parameters are different.  It could easily be adapted with just a little work.  You can find his library here
http://arduino.cc/forum/index.php/topic,60802.0.html
Logged

Nova Scotia
Offline Offline
Full Member
***
Karma: 4
Posts: 186
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the code. Grabbed the latest newsoftserial ,replaced the old and had the random rectangles on the screen. No possibility of adding a transistor to the power pin of the display on my project so I tried removing and then editing display.powerUp(); so the display would be always connected to 5V but have not had luck yet. It probably a timing thing.

Thanks,
Mike
Logged

Spain
Offline Offline
Full Member
***
Karma: 0
Posts: 149
LED
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried removing and then editing display.powerUp(); so the display would be always connected to 5V but have not had luck yet. It probably a timing thing.
Pardon?
Logged

Arduino Uno (R2fix) / Duemilanove (328p)
Ethernet Shield SD (v5)

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All you need to do to disable the power or reset pin functionality is just set that pin to -1 when you setup your object.

The library isn't really setup to properly use the reset pin, but if in the constructor you change the digitalWrite to _resetPin to LOW instead of HIGH and then change the powerDown function to this
Code:
bool G4D::powerDown()
{
  char retVal;

  bool success = false;
  retVal = control(G4D_DISPLAY_CONTRAST,0);
  if(retVal == true) {
  success = true;
  }

  retVal = control(G4D_DISPLAY_ON,0x00);
  if(retVal == true) {
  success = true;
  }

  if(success == true) {
  delay(150);
  if(_resetPin>-1) digitalWrite(_resetPin, LOW);
  if(_powerPin>-1) digitalWrite(_powerPin, LOW);
  return(true);
  }
  return(false);
}

Then you should still get proper functionality out of the startup and shutdown code without a power transistor.
Logged

Pages: [1]   Go Up
Jump to: