home bbs files messages ]

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

   alt.energy.homepower      Electrical part of living of the grid      2,576 messages   

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

   Message 923 of 2,576   
   Jim Wilkins to Curbie   
   Re: 1kW $50 E-Cat ?   
   30 Jan 12 15:01:21   
   
   From: muratlanne@gmail.com   
      
   "Curbie"  wrote in message   
   news:eapdi71gob6lvn8gae0v3lm2oqdh964aof@4ax.com...   
   > Jim,   
   >   
   > If the required response time is < 1ms, just poll (no interrupt), the   
   > real issue is whether the commands must run in a particular order, in   
   > which case you'll need a run-queue, if not just use a command and   
   > response loop like below.   
   >   
   > Also, if your timed events are not more than ~50 days apart, the   
   > milliSec() function below handles timing register restarts.   
   >   
   > If you need, LCD displays, buttons, or DS1820 perature sensors, let me   
   > know, I have software for all that.   
   >   
   > Curbie   
      
   >   
   > button = getButton();                               // get value of   
   > button currently being pressed   
   > if ( button != BV_NONE ) lastButton = button;       // if button   
   > pressed, save its value   
   > readTemperatureSensors();                           // if all   
   > temperature sensors are not found, isolate failed sensor   
   >   
   > if ( menuCmd ) menuRes();                           // if check for   
   > menu button pressed command, run response   
   > if ( selectCmd ) selectRes();                       // if check for......   
   >.....   
      
   I wrote essentially the same thing in QBasic using an INKEY$ procedure to   
   read the keyboard, including the  and function keys,  and SELECT CASE   
   to parse it, on the assumption that the program runs faster if it loops   
   after the first TRUE match and there is only going to be one button push or   
   keystroke detected per pass. Also I can keep the line shorter and neater   
   when testing for multiple equivalent conditions like CASE "+", "=", plus   
   arrow key character pairs.   
      
   Compiled code in DOS ran more than fast enough but interpreted code under   
   Windows was sometimes slow enough to see the spinning * ( | / - \ | / - \ )   
   loop speed indicator advance.   
      
   Instead of scheduling calls I set flags and state variables so I could   
   evaluate a matrix of the changed conditions all at once after completing the   
   loop and prioritize the responses, sort of a state machine without all the   
   formalities. The code was easier to figure out a month later if the sensing   
   and decision-making were grouped separately.   
      
   I'll probably leave the Arduino connected to a laptop for input, file   
   storage and display. I have a Dell D610 downstairs running days-long tests   
   on a failing 2T hard drive. The KAWez says they cost $0.15 a day.   
      
   jsw   
      
   --- 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