Particle Photon OLED screen and SD card demo


#41

Yea, I tried a couple of different routes, including the SDFat lib and didn’t manage to get it working (although I don’t think I ran into that particular error; you have the file there on disk, right?)


#42

Thank you for the tips! Indeed, I started working on it in Dev. Even though the library was locally installed in the project folder, it kept giving the same error. All the other libraries work fine, except for the SDFat. I’ll try it in Build as well, hopefully it will compile.


#43

Hello to all!

I’m trying to build a smart alarm clock with the old screen SSD1351 based on the GitHub exemples above but it’s not working. It won’t compile and I get no error message.

Could someone explain to me how to proceed step by step to check if I’m doing anything wrong?

Thanks a lot


#44

@Moonbrain, which library (link if possible) are you trying to use?


#45

Hi Peekay! Thank you for your reply.

I was trying to use the Adafruit_SSD1351 and getting inspiration from https://github.com/mikeseeh/photon-demo-oled-sdcard
I noticed the path to the file in the library has change from Adafruit_SSD1351.h to Adafruit_SSD1351_Photon.h, so I changed it

I also tried to do a test with the OLED_test.ino from this GitHub which uses the same library https://github.com/nfriedly/Adafruit_SSD1351_Photon

Now I realize I was being stupid, because I haven’t declared my USB port. Which I need to transfer images to the SD card.

So my question is, can we do that from https://build.particle.io/build or is it only for wifi transfer.
https://docs.particle.io/guide/getting-started/connect/core/ <-- This is what I should follow to do it like I usually do with Arduino right?

Thank you for your help :slight_smile:


#46

There is no “direct” method for transferring a bitmap file from your PC to an SD card on a Photon unless that Photon is running an application that does this. Normally, you load the SD card with bitmap files which you can then access via an application on the Photon (eg. the bitmap draw app).

The nfriendly library is a recent library which is accessible on the web IDE but doesn’t have the microSD example you want. I recently wrote a bitmap display demo for the ILI9341 which should work with the SSD1351 since it uses the generic drawPixel() call. Couple with the SDFat library, also on the web IDE, you should be able to use it.

As for wiring, the Arduino pins don’t use the same naming convention. I believe the nfriendly github README has the correct wiring. I’ll try to post the bitmap display code tonight for you to try.


#47

Yes I already wired the screen following the instructions of nfriendly github so that should be fine :slight_smile:

I’ll wait for the bitmap display code than, thank you so much!


#48

@Moonbrain, have you tested the display as-is without the SD code? Getting that working will make the rest a lot easier to debug if any problems arise.


#49

No I haven’t. How can I do that? (The tutorials I found only test with SD).


#50

The example app from the library should work well to test the display:

https://build.particle.io/libs/Adafruit_SSD1351_Photon/0.0.6/tab/example/OLED_test.ino


#51

@Moonbrain, have you had a chance to test with the demo pointed to by @kennethlimcp?


#52

@peekay123 @kennethlimcp Yeah just tried it, it’s working! Thanks a lot. Not sure what was wrong with me creating the ino file myself in my first trials. But it’s doing great now! I’ll come back to you if I get stuck further in the process :slight_smile:


#53

@Moonbrain, do you still need the bitmap viewing code?


#55

@peekay123 Yes definitely! That would be awesome!


#56

@Moonbrain, here is a link to the bmp display app I put together for you:

https://go.particle.io/shared_apps/5939f9303826de3d520010aa

Note that you will need to get the “lily128.bmp” file from the Adafruit github site and put it in the root of the microSD card you will be using.

For wiring, D2 is used as the CS pin for the SD and the display uses these pins besides the SPI pins:

#define TFT_DC  A1
#define TFT_CS  A2
#define TFT_RST D3

Let me know how things go!


#57

@peekay123 Hi! Thank you so much for the code.
So far, it’s not working though I get a snowy screen no matter if the card is in or out (I did not forget to upload the bmp).


So I’m wondering if the wiring is wrong or if it can’t find the image.

D7 -> OLED

3V3 -> 3Vo (3V)
GND -> GND (G)

A1 -> DC
D3 -> RESET ®

A5 -> MOSI (SI)
A3 -> SCK (CL)

A2 -> SDCS (SC)

I’ve tried other with no success

Also after I fire the code it keeps on getting offline and I have to reset. Is that normal?

Thanks for your help!


#58

@Moonbrain, I don’t think you have the CS connections right.

D2 -> SDCS (SC)
A2 -> TFT_CS

:wink:


#59

If TFT_CS is OLEDCS than I still get snowy screen.
If not I don’t understand which is it?


#60

@Moonbrain, is the file on the SD card? Also, open a terminal session to see the Serial.print() debug message show.


#61

Yes it is. I don’t have the set-up to see anything in the terminal. Should I install openOCD?