Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: C-Basic Probl. Kategorie: Programmierung Basic (von eddy - 9.01.2005 18:40)
 Als Antwort auf Re: C-Basic Probl. von JanPeter - 7.01.2005 13:19

>
> Nimm eine Unit erweitere sie über I2C (5*PCF8574) Sie haben 8 weitere ports, also 5*8=40 Ports
> Aufteilung der Ports:
> pro Motor 2Ports (zur Richtungsumschaltung)
> pro Rollo 2Ports (Endanschlagkontakte)
> macht 36 Ports.
> MfG
> JanPeter
>

Hallo JanPeter,

hmm I2C.. wie würde dann die Schaltung aussehen? Braucht man extra-treiber dafür?
was müsste man beachten?
Also preislich liegen die bei 1,70/Stück (Reichelt) also nicht zu vergleichen mit der vertigen Porterweiterung von Conrad (ca.18EUR/Stück)

@Kai

das Programm hab ich hingekriegt, hier für 4 Motoren:

define tconst1 200   'Zeitkonstante 1
define tcount1 word[1]
define key_up1   port[1]
define key_down1 port[2]
define rel_up1   port[9]
define rel_down1 port[10]
define merker1 bit[65]
  define tconst2 200   'Zeitkonstante 2
  define tcount2 word[2]
  define key_up2   port[3]
  define key_down2 port[4]
  define rel_up2   port[11]
  define rel_down2 port[12]
  define merker2 bit[66]
    define tconst3 200   'Zeitkonstante 3
    define tcount3 word[3]
    define key_up3   port[5]
    define key_down3 port[6]
    define rel_up3   port[13]
    define rel_down3 port[14]
    define merker3 bit[67]
      define tconst4 200   'Zeitkonstante 4
      define tcount4 word[4]
      define key_up4   port[7]
      define key_down4 port[8]
      define rel_up4   port[15]
      define rel_down4 port[16]
      define merker4 bit[68]
     
#START
  slowmode on
   if key_up1   = off and merker1=0 then goto DRV_UP1
   if key_down1 = off and merker1=0 then goto DRV_DOWN1
   if abs (timer - tcount1) > tconst1 and merker1=-1 then goto STOP1
   if (key_up1 xor key_down1) and merker1=-1 then goto STOP1

     if key_up2   = off and merker2=0 then goto DRV_UP2
     if key_down2 = off and merker2=0 then goto DRV_DOWN2
     if abs (timer - tcount2) > tconst2 and merker2=-1 then goto STOP2
     if (key_up2 xor key_down2) and merker2=-1 then goto STOP2

       if key_up3   = off and merker3=0 then goto DRV_UP3
       if key_down3 = off and merker3=0 then goto DRV_DOWN3
       if abs (timer - tcount3) > tconst3 and merker3=-1 then goto STOP3
       if (key_up3 xor key_down3) and merker3=-1 then goto STOP3

         if key_up4   = off and merker4=0 then goto DRV_UP4
         if key_down4 = off and merker4=0 then goto DRV_DOWN4
         if abs (timer - tcount4) > tconst4 and merker4=-1 then goto STOP4
         if (key_up4 xor key_down4) and merker4=-1 then goto STOP4  
   goto START

#DRV_UP1
   print "        DRV 1 UP >>>>>>>"
   wait key_up1
   rel_up1 = on
   tcount1 = timer
   merker1=-1
  goto START
#DRV_DOWN1
   print "        <<<<<<< DRV 1 DOWN"
   wait key_down1
   rel_down1 = on
   tcount1 = timer
   merker1=-1
  goto START
#STOP1
   print "STOP 1"
   rel_up1   = off
   rel_down1 = off
   wait key_up1
   wait key_down1
   merker1=0
  goto START

#DRV_UP2
   print "        DRV 2 UP >>>>>>>"
   wait key_up2
   rel_up2 = on
   tcount2 = timer
   merker2=-1
  goto START
#DRV_DOWN2
   print "        <<<<<<< DRV 2 DOWN"
   wait key_down2
   rel_down2 = on
   tcount2 = timer
   merker2=-1
  goto START
#STOP2
   print "STOP 2"
   rel_up2   = off
   rel_down2 = off
   wait key_up2
   wait key_down2
   merker2=0
  goto START
 
#DRV_UP3
   print "        DRV 3 UP >>>>>>>"
   wait key_up3
   rel_up3 = on
   tcount3 = timer
   merker3=-1
  goto START
#DRV_DOWN3
   print "        <<<<<<< DRV 3 DOWN"
   wait key_down3
   rel_down3 = on
   tcount3 = timer
   merker3=-1
  goto START
#STOP3
   print "STOP 3"
   rel_up3   = off
   rel_down3 = off
   wait key_up3
   wait key_down3
   merker3=0
  goto START
   
 #DRV_UP4
   print "        DRV 4 UP >>>>>>>"
   wait key_up4
   rel_up4 = on
   tcount4 = timer
   merker4=-1
  goto START
#DRV_DOWN4
   print "        <<<<<<< DRV 4 DOWN"
   wait key_down4
   rel_down4 = on
   tcount4 = timer
   merker4=-1
  goto START
#STOP4
   print "STOP 4"
   rel_up4   = off
   rel_down4 = off
   wait key_up4
   wait key_down4
   merker4=0
  goto START

 Antwort schreiben

Bisherige Antworten:

Re: C-Basic Probl. (von Kay - 10.01.2005 8:26)