home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,189 of 2,978   
   HoofdSluisMeester to All   
   little problem   
   19 Dec 04 18:33:47   
   
   From: kieperermaarin@hetemail.com   
      
   I have a problem...   
      
   I am building a program to control a electric driven door.   
      
   The program counts pulses from a switch on the motor.   
      
   When i start the routine the motor starts running and after several pulses   
   he has to speed up a bit an after more pulses to slow down and again after   
   some pulses stop.   
      
   My problem is this:   
      
   When the swith is on the PULSE has to increse with 1. My routine adds   
   numbers to Pulse as long as IO 2 is on.   
      
   How kan i add only 1 to Pulse every time when IO 2 is on?   
      
   kieperermaarin@hotmail.com   
      
      
      
   this is the program whithout all the options to show on the screen.   
      
   Its just for indicating.   
      
      
      
   procedure puls;   
      
   VAR pulse : byte;   
      
   begin   
      
   pulse := 0;   
      
   Repeat   
      
   setiochannel(1)   {start motor}   
      
   readiochannel(2) {read input from swith on motor }   
      
   IF IO(2) {swith on motor active} then pulse := Pulse +1   
      
   IF pulse = 5 then {speed up motor}   
      
   IF pulse = 50 then {speed down motor}   
      
   IF pulse = 55 then cleariochannel(1) {stop motor}   
      
   until pulse =55;   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca