ssd1306: drawPixel u,32, 1 ' **** does not work! Why? ****


+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    dima
    Guest dima's Avatar

    0 Not allowed!

    Default ssd1306: drawPixel u,32, 1 ' **** does not work! Why? ****

    Device = 18F452
    Xtal = 20
    @Config_REQ
    @__Config Config1H, OSCS_OFF_1 & HS_OSC_1
    @__Config Config2L, BOR_OFF_2 & BORV_20_2 & PWRT_ON_2
    @__Config Config2H, WDT_OFF_2 & WDTPS_128_2
    @__Config Config3H, CCP2MX_OFF_3
    @__Config Config4L, STVR_OFF_4 & LVP_OFF_4 & DEBUG_OFF_4

    Declare Stack_Size = 10

    Dim loopCount As Byte 'Dim var, general counter
    Dim var1 As Word

    Dim u As Dword
    Dim w As Dword
    Dim m As Float
    Dim m1 As Float
    Dim xxxx As Float
    Dim xx1 As Float
    Dim x2 As Float
    Dim x3 As Float
    Dim yyyy As Float
    Dim yy1 As Float
    Dim y2 As Float
    Dim y3 As Float
    Dim r As Float
    'Include "1306_include.inc" ; include the Nokia driver file
    Include "ssd1306_24.11.2016.inc"

    Declare Hbus_Bitrate 1000


    Display_INIT ; Nokia 3310 display init

    DEMO_EXAMPLES:

    Clear_Mem ; clear nokia lcd software video buffer


    For u=1 To 123'300


    drawPixel 22, 45, 1 ;Draw Black box of 9 pixels on the inverse background
    drawPixel 23, 45, 1 ;drawPixel was already available but not in the Demo.bas
    drawPixel 24, 45, 1
    drawPixel 22, 46, 1
    drawPixel 23, 46, 1
    drawPixel 24, 46, 1
    drawPixel 22, 47, 1
    drawPixel 23, 47, 1
    drawPixel 24, 47, 1



    drawCircle 64, 32, 10, 1

    drawPixel u,32, 1 ' **** does not work! Why? ****

    SelectFont f8x11
    Print At 5,17, Dec u
    refreshMem 0
    DelayMS 500

    Next u

    DelayMS 1000
    GoTo DEMO_EXAMPLES
    ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    ; include FONTS section
    ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    $ifdef use_Font_f8x8
    Include "f8x8.inc"
    $endif
    $ifdef use_Font_f13x16
    Include "f13x16.inc"
    $endif
    $ifdef use_Font_f8x11
    Include "f8x11.inc"
    $endif
    $ifdef use_Font_f12x12
    Include "f12x12.inc"
    $endif

    ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>


    drawPixel u,32, 1
    does not work! Why? [ u,32,1]
    Last edited by dima; 10th January 2017 at 07:16.

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Member Dompie's Avatar
    Join Date
    Apr 2012
    Posts
    123
    Thumbs Up
    Received: 14
    Given: 12
    Total Downloaded
    5.03 GB

    0 Not allowed!

    Default Re: ssd1306: drawPixel u,32, 1 ' **** does not work! Why? ****

    Yes I have the same problem!!
    The problem arises somewhere in the Macro definition of the parameters, I have no idea why. The internal references to drawPixel don't give these problems. I am not a Macro-specialist so I have solved the problem in an ugly(?) matter.
    I inserted in the .inc file a preprocessor statement with $Define and another name than drawPixel.
    $define TekenPixel(P1, P2, P3) '
    ppx = P1 '
    ppy = P2 '
    Color = P3 '
    GoSub drawPixel_SUB
    !!!Donít forget the quotes!!!!!
    Now in my program I use for the drawing of a pixel TekenPixel(bXvar, bYvar, 1) and everything works as designed.

    By the way, I saw that there are several errors in the drawLine routine. Swapping only x-coordinates and not the corresponding y-coordinate isnít smart. Also using yy variable instead of y0 is sloppy, defining (stepx) stepy as DWORD and assign stepy = -1 doesnít work either, you need signed variables. I havenít use drawCircle but I expect the same kind of errors in that subroutine. It looks like a bad conversion of C-subroutines.
    At the moment I am too busy but in the coming months I will correct these errors, if nobody else correct them.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. SSD1306 lcd problem
      By Maxi in forum LCD module
      Replies: 11
      Last Post: 24th September 2019, 13:20
    2. SSD1306 display
      By charliecoultas in forum Proton Plus Compiler v3
      Replies: 2
      Last Post: 29th August 2019, 10:26
    3. Grafic-SSD1306 OLED a new version
      By Dompie in forum LCD module
      Replies: 9
      Last Post: 12th October 2017, 16:05
    4. Help With OLED Display / 128X64 SSD1306
      By Denner in forum LCD module
      Replies: 69
      Last Post: 8th January 2017, 01:00

    Members who have read this thread since 9th December 2019, 04:25 : 0

    Actions :  (Set Date)  (Clear Date)

    You do not have permission to view the list of names.

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts