-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Almost works with ESP8266 #1
Comments
Hi, Thank you for reporting the issue and sorry about the delay, I'll have a look into it asap. |
Hi Mike, I haven't honestly tried the driver with the esp port yet and used WiPy for developing, which still works okay. The problem might be related to the fact that esp SPI is implemented in software, as opposed to WiPy. I'll get my hands on the esp board again and will try to make it work. You should explicitly define the pins as Pin.OUT by the way. |
Try changing the line in the tft module's write_cmd: self.spi.write(cmd) to self.spi.write(bytearray([cmd])) |
Thanks for contributing this driver it looks really well written and commented however...
|
class Spi2(pyb.SPI):
def write(self, b):
self.send(b)
class Hack(TFT_GREEN):
def __init__(self):
width=128
height=160
spi=Spi2(1,pyb.SPI.MASTER)
dc=pyb.Pin('X2', pyb.Pin.OUT)
cs=pyb.Pin('X5', pyb.Pin.OUT)
rst=pyb.Pin('X4', pyb.Pin.OUT)
bl=pyb.Pin('X3', pyb.Pin.OUT)
super().__init__(width, height, spi, dc, cs, rst, bl)
pass |
sorry I cant get the damn markdown to do anything sensible.. presumably crapness on my part |
Hi @PeterKenyon, To figure out how to use the SPI and others with your board, see the official docs and make sure you're looking at the right board: pyboard, wipy etc., but looks like you're using pyboard. The I am not familiar with GHI N18 boards, but a quick google suggests they are indeed using the st7735. The "tab" stuff is actually quite confusing: displays come with a little protective film over them and the "tab" that you can use to pull the display off has a particular colour, in my case it's green. This tab affects the way in which you would init the display before using it. You can read more about it in the st7735 datasheet if you're into that sort of thing. I am planning to add other display versions too. If you want to have a go at adding your version, create a new sublass from TFT and implement the init function yourself, exactly the way the TFT_GREEN class is written. Hope this helps! |
thanks, I have actually got it working as you recommend, I just used GHI's C# init code and translated into python. I created a N18 subclass similar to your GREEN_TAB. (Incidentally my tab is orange) |
Great! Glad to hear you got it sorted. Also feel free to contribute your N18 On Tue, 21 Jun 2016, 13:36 PeterKenyon, [email protected] wrote:
|
Greetings, This is what it gives me now: I would definitely appreciate any assistance in getting this screen working on the ESP8266. |
Hi @Andon-A, I haven't had much time recently to follow micropython/esp8266 development due to my full-time job being busy. It does look like a simple type conversion problem that shouldn't be too hard to debug, but I need to see how you're using the driver. If you find any issues related to the driver itself, by all means please submit PRs and I hopefully will find time to review them! |
Thanks to hosaka for his great work! I got it running with micropython v1.8.7 on an esp-12f board. Some minor fixes have to be taken. A stright forward job :-) I use a display ordered from china (ebay).
|
Just played with an other display module. There I must use polarity=0 for the SPI bus. This results also in swapping colors from RGB to BGR. Strange! |
Hey @tmueller1970 Thanks for the patch, the changes look good, and all due to my mistakes :) Feel free to submit a PR, I'll be happy to merge the changes so others can use the driver and extend it. |
God, you exist! Incredible. Thank you, @hosaka @tmueller1970 !
The code variant @hosaka + @tmueller1970 perfectly works.
This drawing lasts 99 seconds) |
Tried using your library on a WeMos D1 mini running MicroPython v1.8.138
Almost works. Calls to
self.write_cmd()
are failing as it requires a buffer.The text was updated successfully, but these errors were encountered: