I2c zu LCD in Bascom

Gast #99079
Lesenswert?
• ▲
▼
Guten Abend
Habe ich mir doch mal dieses Example angeschaut und probiert.
http://www.mcselec.com/an_118.htm
Funktioniert bis auf die string ausgabe auch perfekt.Hat schon jemand
mal dieses Example versucht und zum laufen gebracht?
Oder hat jemand eine Ahnung warum die LCD Anzeige nur Steuercodes an
nimmt?

Code:

$regfile = "2313def.dat"
'AT90S2313
$crystal = 4000000
$lib "Lcd_i2c.lib"                                          'My i2c
driver for the LCD
Const Pcf8574_lcd = &H40'Defines the address of the I/O expander for
LCD                                      'Für Bit 3 Von Portd
Config I2cdelay = 1
Config Scl = Portb.3                                        'Configure
i2c SCL
Config Sda = Portb.2                                        'Configure
i2c SDA
Dim _lcd_e As Byte                                          'Needed to
control 4 line LCD



_lcd_e = 128                                                'Upper
half of 4-line display is selected

Config Lcd = 16 * 4                                         'configure
lcd screen

Wait 1
Cursor On Blink
Display On
Do


Cls                                                         'clear the
LCD display

  'Portd.4 = 1                                               'Rote
LED (Pin PD3) an
  'Portd.3 = 1
  'Waitms 500
  'Portd.4 = 0
  'Portd.3 = 0                                               'Rote
LED aus
  'Waitms 100
Lcd "Hello world."                                          'display
this at the top line
'select the lower line
Wait 1
Lcd "Otter"                                                 'display
this
Wait 2


  'Portd.4 = 1                                               'Rote
LED (Pin PD3) an
  'Portd.3 = 1
  'Waitms 500
  'Portd.4 = 0
  'Portd.3 = 0                                               'Rote
LED aus
  'Waitms 100

'Wait 2
Loop
End

Antwort schreiben

Hinweis: der ursprüngliche Beitrag ist mehr als 6 Monate alt. Bitte hier nur auf die ursprüngliche Frage antworten, für neue Fragen einen neuen Beitrag erstellen.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.