Displaying the value of a variable

donrecardo

Senior Member
Hi
I have just been playing with my new bargain serial OLED display.
Rev Ed were not kidding when they said if you use an OLED you wont
use LCD again. the brightness and contrast is fantastic and best of
all you can read it from pretty much any angle

Anyway, I have 3 questions...

I know that serout B.7, N2400,("A") will display a capital A on the display
just as serout B.7, N2400, (65) will also display the same capital A

Now suppose I read an ADC input into var b1 and lets say its value is 88
how do I get it to display the value of b1 " 88" rather than the character
"X" which relates to 88


second question is ...
The instruction sheet that came with it shows on appendix A the characters that
correspond to each Hex Value , except it seems to tell lies .
According to the sheet the Hex value DE ( dec 222) should give the omega symbol
but it doesn't . and many of the others seem to be wrong too
It even shows characters for FD,FE and FF , but surely that must be wrong as
253, 254 and 255 are command codes.
Is there a data sheet that gives the true characters that I will display for each
character code?

Lastly , the Appendix A shows 00 to 0F to be CG Ram locations which I think might be
areas where we can store and retrieve 16 user designed characters ? but I can see nothing
on the supplied sheet to say how to load or read these , Is there a manual /data sheet that explains this ?

Regards
Don
 

Svejk

Senior Member
1. Have a look at bintoascii instruction. Also using serout b.7, N2400, (#b1) should display the value.

2. The omega character is 0xF4 according to datasheet to my LCD. Maybe is worth trying .

3. A good tutorial may be found here.
 

hippy

Ex-Staff (retired)
Sending a variable as a displayed value is done by either prefixing with # in the SEROUT or by using the BINTOASCII command and sending the resulting characters separately.

b0 = 123
SerOut B.7, N2400, ( #b0 )

and

b0 = 123
BinToAscii b0, b1,b2,b3
SerOut B.7, N2400, ( b1, b2, b3 )

Will both display "1", "2" then "3" on the LCD.

We would have to look at the datasheet and try the character codes to check they match with characters displayed. It may depend on what mode the display is in or which display is being used, LCD or OLED. It may even be the displays do not match the data we were provided with.

Displaying characters for $FD, $FE and $FF would require a 'display next character byte' command to be added. I'm not sure if that wiould be worth adding ( CGRAM could duplicate those characters if needed ) but I've made a note of it.

To display user CGRAM characters simply use $00 to $0F as character values. To program those CGRAM characters you would need to send a 'Program CGRAM' command prefixed with 254 and then the character data as per the AXE033. I'll have to check if we have that described anywhere.
 

Technical

Technical Support
Staff member
All OLEDs/LCDs brands vary slightly in their character maps, in fact the OLED has 4 different maps you can choose by reprogramming the AXE133 firmware (WesternEuropean is the AXE133 firmware default). Values 253, 254, 255 are 'hijacked' for special purpose by the AXE133 firmware.

The full OLED controller datasheet with character maps and CGRAM details here:
www.picaxe.com/docs/oled.pdf
 
Last edited:

hippy

Ex-Staff (retired)
I forget who discovered there were actually two different Western European Font sets and that's now included in Technical's link above.

The AXE133 firmware for the 18M2 Budget OLED / LCD driver can be found by using File -> Open Samples, "AXE133 Serial OLED.bas". Around line 117 you'll find ...

let pinsB = %00111000 ; 8 bit, 2 line, 5x8 , English_Japanese table
let pinsB = %00111001 ; 8 bit, 2 line, 5x8 , Western_European table
let pinsB = %00111010 ; 8 bit, 2 line, 5x8 , English_Russian table

To set the second Western European Font set as the default with the Ohm symbol at $DE use ...

let pinsB = %00111011 ; 8 bit, 2 line, 5x8 , Western_European table 2

But - even simpler - you can just tell the OLED to use a different font set from your master PICAXE program ...

SerOut 2, N2400,( 254, %00111011 )

Change the two lsb to indicate which font set to use.
 

donrecardo

Senior Member
Thanks for the reply's that was really helpful . especially the OLED pdf
and the use of #b1 to display the value of b1

Many Thanks

Don
 

John West

Senior Member
Problems tend to go away very quickly when both Hippy and Technical are working on them. While there are numerous very knowledgeable posters helping out around here, (certainly enough to impress me,) still, I read very carefully the threads where I see the "Technical Support" title beneath the posters names. Those threads tend to be short, succinct, informative and correct.
 

hippy

Ex-Staff (retired)
Appendix A shows 00 to 0F to be CG Ram locations which I think might be areas where we can store and retrieve 16 user designed characters ? but I can see nothing on the supplied sheet to say how to load or read these
Most LCD displays have a capability of programming 8 'user defined characters' these are usually character codes 0 to 7 ( $00 to $07 ) and they are usually duplicated at 8 through 15 ( $08 to $0F ). The OLED is compatible with this scheme.

That means that you can use the Programming Editor AXE033 CGRAM Wizard to create user defined characters and see the code generated which will put them into the display's memory.

Once you've defined a character and run the appropriate code you simply send the character code 0 to 7 ( or 8 to 15 ) and it will appear just like any other.
 

John West

Senior Member
Much thanks for the replies.

Are there enough US orders for Tech Supplies to add US dollar prices to the products? I find the lack of such price info a small impediment when I am considering purchases for shipment to the US. But any impediment, even a small one, is worth considering when the idea is to sell your products to as many folks as possible.
 
Top