Zur Übersicht - INFO - Neueste 50 Beiträge - Neuer Beitrag - Suchen - Zum C-Control-I-Forum - Zum C-Control-II-Forum

Re: I2C-Bus 5-fach Relaisbox Kategorie: I²C-Bus (von Franz-Peter - 9.12.2014 9:56)
Als Antwort auf Re: I2C-Bus 5-fach Relaisbox von Wiegelmann - 6.12.2014 13:10
Ich nutze:
C-Control Pro Mega32, C-Control Pro Mega128, CC-Pro 128 Application Board
> > > Hallo,
> > >
> > > hat jemand die I2C-Bus 5-fach Relaisbox von csslabs.de an der C-Control Pro laufen
> > > und kann mir die entsprechenden Code-Schnippsel in C oder Basic zur Verfügung stellen?
> > >
> > > Vielen Dank
> > > Sebastian
> > >
> >
> > Hallo, ja ich habe das Modul.
> > Jedoch bicht der Compiler ab.
> > Ã?bersetze Projekt Relais_I2CBus
> > C-Control Pro Compiler (C) 2011  Conrad Electronic
> > Durchlaufe Pass 1
> > C:dataC-Control Mini CDRelaysRelais_I2CBus.cbas(1,26): Syntax Fehler - unerwartetes Symbol: 'byteport'
> >
> > Hier der Code:
> >
> > Dim  RelBoxBytePort  As  byteport[5]
> > Dim Rel1         As    Port[33]
> > Dim Rel2         As    Port[34]
> > Dim Rel3         As    Port[35]
> > Dim Rel4         As    Port[36]
> > Dim Rel5         As    Port[37]
> >
> > Dim i As byte
> >
> >
> >
> > Sub Init_RelBox()
> >     define SDA port[9]
> >     define SCL port[10]
> >     SDA=on
> >     SCL=on
> >     LCD.INIT
> >     LCD.OFF
> >     RelBoxBytePort=0
> > End Sub
> >
> >
> > Sub SwitchPort (Nr As Byte, State As boolean)
> >     Select Case Nr
> >         Case 1
> >             Rel1=State
> >         Case 2
> >             Rel2=State
> >         Case 3
> >             Rel3=State
> >         Case 4
> >             Rel4=State
> >         Case 5
> >             Rel5=State
> >     End Select
> > End Sub
> >
> > Sub Main()
> >
> >     MINI_INIT()
> >     Init_RelBox()
> >     for i = 1 to 5
> >         pause 50
> >         SwitchPort (i,on)
> >     next
> >     pause 1000
> >     for i = 1 to 5 Step -1
> >         paise 50
> >         Switchport (i,off)
> >     next
> >
> > End Sub
> >
> > Schaltet die Relais nacheinander ein und wieder aus.
> > Ich habe den Code von css.
> > Hat jemand eine Idee, woran das liegt?
> > Habe bisher keine Erfahrung mit dem I2C.

Hallo Jürgen,
Der Code ist für die CControl I, der funktioniert für die CControl Pro nicht.
Die CControl I hat da eine ganz andere Syntax und andere Bibliotheken.
Für die CControl pro müsste der Code komplett neu geschrieben werden.

GruÃ?
Franz-Peter


    Antwort schreiben


Antworten: