SSD1306 I2C with Pic16f1937!

For general Flowcode discussion that does not belong in the other sections.
mnfisher
Valued Contributor
Posts: 1462
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 136 times
Been thanked: 713 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

Thanks Iain,

Yes - hopefully useful. Though most MCUs have way more resources than a project needs.

It did strike me that it could do a neat bar chart too - see the first demo where it fills a line. Filling with 0b01111110 (or other value) would allow a neat 4 channel VU meter?

Martin

jgu1
Posts: 777
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 670 times
Been thanked: 175 times

Re: SSD1306 I2C with Pic16f1937!

Post by jgu1 »

Hi Martin!

So far many thank´s. I will make some more test tomorrow :D

You hear!

Jorgen

jgu1
Posts: 777
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 670 times
Been thanked: 175 times

Re: SSD1306 I2C with Pic16f1937!

Post by jgu1 »

Hi again Martin (and Lian, guess you also follow)!

I have made a test with the new Component. :D Working perfect, and the size of the font is also good for this tiny display, I use the one with the yellow "first line"

Again thank´s Martin for your great job. ;) now I continue my project with the Pic16f1937.

Try to test my exable :lol:

Br jorgen
Attachments
Martins SSD1306 Component Test.fcfx
(14.33 KiB) Downloaded 172 times

mnfisher
Valued Contributor
Posts: 1462
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 136 times
Been thanked: 713 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

Thanks Jorgen,

Last night I made a meter (bar chart) function.

Got too late - will upload today...

I also found an issue. Strings must have a 0 terminator. I used a 2 character string for a two digit string and got some extra bits displayed. Length$ would be slightly slower and larger.

It was intentional - but there are generally no checks on parameters being in range. So if you try and print a string that is too long then corruption will occur. Or try and print off screen.
The trade of is size - extra checks are extra code.

The more I use it the more I like the idea of using line numbers for text. I'll perhaps change and see what you think.

It was summer yesterday (as Iain mentioned elsewhere) so didn't do much 😎

Martin

chipfryer27
Valued Contributor
Posts: 1528
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: SSD1306 I2C with Pic16f1937!

Post by chipfryer27 »

Hi Martin

It's still summer for another day here and I'm now more a shade of cream rather than pure milk bottle...... Yesterday I did a task I loathe, gardening. Maybe I can build a robot of sorts that shoot fire to incinerate weeds or something? Better yet, it can just bring me bottles of Northern Light or Puffin and I'll just call the back "garden" a wildlife/plant sanctuary :)

I like the little displays as they are a good size for projects that don't need acres of space. Having numbered lines is I think a nice idea as if you are short of resources you are most likely just displaying text, and the numbers make it easy to position.

Enjoy the heatwave :)

Regards

jgu1
Posts: 777
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 670 times
Been thanked: 175 times

Flowcode v10 Re: SSD1306 I2C with Pic16f1937!

Post by jgu1 »

Hi both!

It is also a heat wave here in Denmark 27-30gr and high humidity, also today, I took the family to the beach yesterday.
Ok with the string, I didn´t notice anything :lol: I look forward to seeing your update.

Jorgen

chipfryer27
Valued Contributor
Posts: 1528
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 549 times

Re: SSD1306 I2C with Pic16f1937!

Post by chipfryer27 »

Hi Jorgen

Last time we had Danes on our beaches it left a legacy https://largsvikingfestival.co.uk/ :lol: It is actually quite a decent event.

Enjoy the heat as it will all too soon be cold again :(

Regards

jgu1
Posts: 777
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 670 times
Been thanked: 175 times

Re: SSD1306 I2C with Pic16f1937!

Post by jgu1 »

Ha ha Lian, yes strong danish Viking :lol:

mnfisher
Valued Contributor
Posts: 1462
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 136 times
Been thanked: 713 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

Summer - bah, fog today (haar haar ??)

Breaking change - I've changed y values to be the row (so 0.. number of rows - 1) Saves a lot of shifting to and fro by 3 bits.

I added a VU meter which draws a 'bar'. The bar can be shaded (pass pattern = 0) or a value. The demo draws 4 different lines. Pattern (in the component could be modified to draw a multi-byte pattern if needed) (>>> maybe)
ssd_test.fcfx
(16.81 KiB) Downloaded 175 times
ssd1306_min.fcfx
(36.38 KiB) Downloaded 163 times
Martin

mnfisher
Valued Contributor
Posts: 1462
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 136 times
Been thanked: 713 times

Re: SSD1306 I2C with Pic16f1937!

Post by mnfisher »

A small bug in Flowcode...

If I change a variable name in the explorer - it changes wherever used. If I do Edit Macro Details - and change a parameter name, I need to manually alter each time it is used in the macro.

Post Reply