Quantcast
Channel: Propeller 1 — Parallax Forums
Viewing all articles
Browse latest Browse all 2836

Digole Display Driver

$
0
0
I'm working on my first driver object that I plan to publish on the OBEX.

First a small question: Does the spin compile remove PUB methods that are not used? I think it does, but I'm not sure.

As I've put in the title, it'll be a driver object for a display from Digole

The display I have: 1.8" Color OLED160x128 (the manual)

I 'm planning to put most of the Arduino methods in my driver.

So far I've just been creating the methods and putting some transmit commands in them. With the strings inline
OBJ
  display      : "Simple_Serial"    
  
PUB init(displayPin): Okay

  return display.init(-1, displayPin, 9600) 

PUB initBaud(displayPin, baud): Okay

  return display.init(-1, displayPin, baud)

PUB sendCommand(command)

  display.str(command)

PUB clearScreen

  sendCommand(string("CL"))

PUB enableCursor

  setCursor(1)

PUB setCursor(cursor)

  sendCommand(string("CS"))
  display.tx(cursor)

PUB disableCursor

  setCursor(0)

PUB printString(text)

  sendCommand(string("TT"))
  sendCommand(text)

Is this the best way to go? Or should I put the control characters in the CON or DAT section?

Any help is appreciated. I don't know exactly what the best practices are with the Prop.

Michel

Viewing all articles
Browse latest Browse all 2836

Trending Articles