Announcement

Collapse
No announcement yet.

Diablo16 and Bascom-AVR

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Diablo16 and Bascom-AVR

    Hello all..

    I use at home a uOLED-160-G1 that I connect to an ATMEGA2561 with an self-make Library to control the uOLED via the serial. And this works fine.

    but can this also for the Diablo16 to control it via the serial?

    Look at a small list of my library:

    '===========================================================================' Name: 4D_routines.inc info @ www.hobbyrobots.nl

    ' 4D_systems GOLDELOX-SGC



    ' History: Display: 4D Systems µOLED-160-G1 ============================================================================$nocompile

    '---------------------------------------------------------------0----------------

    ' Init the Display

    '-------------------------------------------------------------------------------

    Sub Init_display()

    Lcd_data(1) = &H55 'Auto Baud

    Call Lcd_send_data(1 , 1)

    '-------------------------------------------------------------------------------

    Call Set_new_baudrate(&H0d) 'Set new Baud Rate

    '06hex = 9600 Baud

    '0Ahex = 38400 Baud

    '0Chex = 57600 Baud

    '0Dhex = 115200 Baud

    '-------------------------------------------------------------------------------

    Call Lcd_clear_screen()

    '-------------------------------------------------------------------------------

    Call Display_control(&H02 , &H0A) 'contrast H00 to H0F dec 0-15



    Call Display_control(&H01 , &H01) 'Display on/off on=01 off=00

    '-------------------------------------------------------------------------------

    ' Call Display_control(&H04 , &H03)

    ' 01hex : 90 Degree rotation (LANDSCAPE if Native is Portrait)
    ' 02hex : 270 Degree rotation (LANDSCAPE_R if Native is Portrait)
    ' 03hex : Native orientation normal

    ' 04hex : 180 Degree rotation (PORTRAIT_R if Native is Portrait)

    '-------------------------------------------------------------------------------

    ' Call Set_volume(&H7f)

    '08hex : Minimum Volume. Dec 08

    '7Fhex : Maximum Volume. Dec 127

    End Sub

    '-------------------------------------------------------------------------------

    'Send Data to the Display Read ACK or no read ACK

    '-------------------------------------------------------------------------------

    Sub Lcd_send_data(byval Leng As Byte , Byval Read_ack As Byte)

    Local Zahl As Byte



    For Zahl = 1 To Leng

    Print #2 , Chr(lcd_data(zahl));

    Next

    If Read_ack = 1 Then

    Call Read_ack()

    End If

    End Sub

    '-------------------------------------------------------------------------------

    'Read Ack from Display H06=ACK byte if successful H15=NAK byte if unsuccessful

    '-------------------------------------------------------------------------------

    Sub Read_ack()

    Local Read_byte As Byte



    Do

    Read_byte = Inkey(#1)

    Loop Until Read_byte > 0 'um jeden Hänger zu vermeiden

    ' Print Hex(read_byte) 'H06

    ' If Read_byte = &H15 Then

    ' Print "Error NAK"

    ' End If



    End Sub

    '-------------------------------------------------------------------------------

    ' This command changes the Baud-Rate

    '-------------------------------------------------------------------------------

    Sub Set_new_baudrate(byval Rate As Byte)

    Lcd_data(1) = &H51 'Set new Baud rate

    Lcd_data(2) = Rate
    Call Lcd_send_data(2 , 1)/p>


    Select Case Rate ' replaceBaud Rate

    Case &H06 : Baud1 = 9600

    Case &H0A : Baud1 = 38400

    Case &H0C : Baud1 = 57600

    Case &H0D : Baud1 = 115200

    End Select

    End Sub



    '-------------------------------------------------------------------------------

    ' Replace Background Color

    '-------------------------------------------------------------------------------

    Sub Lcd_replace_background(byval Color As Word)

    Lcd_data(1) = &H42 'Replace_backg_color

    Lcd_data(2) = High(color)

    Lcd_data(3) = Low(color)

    Call Lcd_send_data(3 , 1)

    End Sub

    etc.

  • #2


    That library is for SGC (as the comment at the top says).

    1. SGC was been discontinued about a year ago and replaced with 4D Serial, which is quite different

    2. 4D Serial is not currently available for Diablo
    Mark

    Comment

    Working...
    X