DLC
jasuk1970 wrote:
> --- In oopic@yahoogroups.com, "jasuk1970" <mail@...> wrote:
>
>> --- In oopic@yahoogroups.com, "rtstofer" <rstofer@> wrote:
>>
>>> --- In oopic@yahoogroups.com, "jasuk1970" <mail@> wrote:
>>>
>>>> Thanks for pointing out the obvious :)
>>>>
>>>> I looked at the I2C write example and it said 0x28 switches
>>>>
>>> backlight
>>>
>>>> off (Figure 11), And it's actually 0x20!
>>>>
>>>> Wehoo it's working :)
>>>>
>>>> Well sort of, I think it's my programming skills lacking now :)
>>>>
>>>> Dim screen As oI2C
>>>> Dim text As New oBuffer(20)
>>>> Dim lp As Byte
>>>>
>>>> Sub Main()
>>>> screen.Node = 0x28 ' 0x50 divided by 2
>>>> screen.Mode = cv7Bit
>>>> screen = 0x20 ' Backlight On
>>>> Call CLS()
>>>> text.VString="Hello World! "
>>>> DisplayText()
>>>>
>>>> End Sub
>>>>
>>>> Sub DisplayText()
>>>> screen.Mode = cv7Bit
>>>> screen = 0x80 ' Send string
>>>> For lp = 0 To 19
>>>> text.Location = lp
>>>> screen = text.Value
>>>> Next lp
>>>> End Sub
>>>>
>>>> Sub CLS()
>>>> screen.Mode = cv7Bit
>>>> screen = 0x8c
>>>> End Sub
>>>>
>>>> Sub BackLightOff()
>>>> screen.Mode = cv7Bit
>>>> screen = 0x28
>>>> End Sub
>>>>
>>>> The screen clears but I cannot get any text to appear.
>>>>
>>>> I think it is I don't understand the IC2 stuff just yet.
>>>>
>>>> Thanks for any help.
>>>>
>>>> Cheers,
>>>>
>>>> Jas
>>>>
>>>>
>>> Setting the mode is only required once.
>>> Why not try simple text without parsing?
>>> Parsing is unlikely to work in any event because you are not
>>>
>> sending
>>
>>> a string. It will, at best, apply to the first character.
>>>
>>> I don't see a .string property for the oI2C object in the V6
>>> documentaton. It DID exist in V5.
>>>
>>> So, we could write things like:
>>> screen.string = "Hello World!"
>>>
>>> Unfortunately, V6 won't accept it!
>>>
>>> Richard
>>>
>>>
>> Thanks for the reply,
>>
>> I've tried without the 0x80 and the same thing happens, the screen
>> switches off. (No flash of the first character like it did with the
>> previous one)
>>
>> I've also tried using the .String = with OOPic 5, but this causes
>>
> the
>
>> back light brightness to flicker and then the screen switches off
>> again.
>>
>> Cheers,
>>
>> Jas
>>
>>
>
> Fixed :) It was simple really. I re-read the docs for oI2C and
> realised I need the screen.NoInc = cvTrue. The command was changing
> on each character. Time to start on a library of commands for the
> screen. Thanks to everyone who helped.
>
> Dim screen As oI2C
> Dim text As New oBuffer(20)
> Dim lp As Byte
>
> Sub Main()
> screen.Node = 0x28 ' 0x50 divided by 2
> screen.Mode = cv7Bit
> screen.NoInc = cvTrue
> screen = 0x20 ' Backlight On
> Call CLS()
> text.VString="Hello World! "
> DisplayText()
>
> Do
>
> Loop
>
> End Sub
>
> Sub DisplayText()
> screen.Mode = cv10Bit
> screen.Location = 0x80 ' Send string
> For lp = 0 To 19
> text.Location = lp
> screen = text.Value
> Next lp
> End Sub
>
> Sub CLS()
> screen.Mode = cv7Bit
> screen = 0x8c
> End Sub
>
> Sub BackLightOff()
> screen.Mode = cv7Bit
> screen = 0x28
> End Sub
>
> Cheers,
>
> Jas
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
--
------------------------------------------------------
Dennis Clark ooPIC Tech Support
www.oopic.com
------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment