home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / tech / etronics / 1.bas (.txt) next >
Encoding:
GW-BASIC  |  1989-01-07  |  1.5 KB  |  33 lines

  1. 100  CLS: REM clear the screen and home cursor
  2. 110  INPUT "supply voltage (4.5 to 16)? ";VCC: REM prompt user for data
  3. 120  INPUT "capacitor in farads? ";C: REM prompt user for data
  4. 130  INPUT "frequency in hz.? ";F: REM prompt use for data
  5. 140  IF F > 500000  THEN PRINT "frequency is out of reliable range": GOTO 130
  6. 150  IF F < 0.000555999 THEN PRINT "frequency is out of reliable range": GOTO 130
  7. 160  INPUT "duty cycle in % (1 to 99)? ";DC: REM prompt for data
  8. 170  IF DC < 1 THEN GOTO 160
  9. 180  IF DC > 99 THEN GOTO 160
  10. 190  RM = (0.3333 * VCC)/2.49E-07: REM max resistor value
  11. 200  DC = DC / 100: REM compute time high
  12. 210  TH = DC / F: REM compute time high
  13. 220  TL = 1 / F - TH: REM compute time low
  14. 230  IF DC < 0.5 THEN GOTO 320: REM diode will be required
  15. 240  RB = TL / (0.67 * C): REM COMPUTE RESISTOR B
  16. 250  RA = TH / (0.67 * C) - RB: REM compute resistor a
  17. 260  IF RB < 3000 THEN PRINT "your capacitor should be smaller": GOTO 400
  18. 270  IF RA < 5000 THEN GOTO 320: REM try again using diode
  19. 280  IF RA > RM OR RB > RM THEN PRINT "you capacitor should be larger":GOTO 400
  20. 290  PRINT "the value of ra = ";RA
  21. 300  PRINT "the value of rb = ";RB
  22. 310  END
  23. 320  RA = TH / (0.67 * C): REM compute resistor a
  24. 330  IF RA < 5000 THEN PRINT "your capacitor should be smaller":GOTO 400
  25. 340  RB = TL / (0.67 * C): REM compute resistor b
  26. 350  IF RB < 3000 THEN PRINT "your capacitor should be smaller":GOTO 400
  27. 360  IF RA > RM OR RB > RM THEN PRINT "your capacitor should be larger":GOTO 400
  28. 370  PRINT "the value of ra = ";RA
  29. 380  PRINT "the value of rb = ";RB
  30. 390  PRINT "the diode will be required"
  31. 400  PRINT :PRINT "                 HIT SPACE BAR TO RETURN TO MENU"
  32. 410  K$ = INKEY$: IF K$=" " THEN RUN "MENU2" ELSE 410
  33.