Radio Transmitter

For your comments, suggestions, or your looking for a circuit or design, or a electronics designer, please send you Inquiries to pcb1001@gmail.com. We are happy to help and attend to your concerns.

Thursday, March 26, 2009

Scriptable Thermometer and Vending Machine

A unified thermometric controller that can be programmed with simple scripts, integrating the "classic" thermometer/controller pair.


You can build a variety of simple machines with the same hardware and a different script : a charting thermometer, a vending machine that dials your number when empty, a leavening cell

  • thermometer with 1°F (0.5C) resolution
  • four switch inputs, four relay outputs
  • only an handful of cheap parts
  • graphic LCD display
  • script interpreter built-in, can run ASCII programs (basic-like)
  • 6KB non volatile script memory
  • full screen editor built-in
  • modular C source code (need a graphic LCD driver?)
  • Two applications provided:

CHARTING THERMOMETER


Load this script to make Scriptherm draw temperature graphs

VAR x,max,min
max = THERM
min = THERM
PRINT ' PROCESS TEMPERATURE'

WHILE 1
PRINT COM,THERM,CR
BOX x+1, 0, x+1, 63, 0
BOX x, 0, x, THERM-32
PRINT @ 7,0,'NOW',THERM, ' MIN',min,' MAX',max,' '
IF THERM>max THEN max=THERM ENDIF
IF THERM
IF IN THEN
max=THERM
min=THERM
IN=0
ENDIF
IF TIME >= 1 THEN
x=(x+1)%128
TIME=0
ENDIF
WEND


SMS PHONE-MAIL ENPOWERED VENDING MACHINE



Load this script to control a refrigerated vending machine that sends you a SMS phone mail message when empty.

VAR sel,sold
THRE=38 HYS=-2

PRINT
@ 1,0,'1) COCA COLA',
@ 3,0,'2) DIET COKE',
@ 5,0,'3) ICE TEA'
BOX 0,0, 127,9

WHILE 1
IF TIME>30 THEN select(0) ENDIF
IF IN&32 THEN select(1) ENDIF
IF IN&64 THEN select(2) ENDIF
IF IN&128 THEN select(3) ENDIF
IF IN&8 THEN dispense() ENDIF
IF (IN&7) != sold THEN soldout() ENDIF
WEND

FUNCTION select(n)
IF n THEN
PRINT @7,0,' INSERT MONEY '
IF (sold & (1<<(n-1))) THEN n=0 PRINT @7,0,' CHANGE SELECTION!' ENDIF ELSE PRINT @7,0,' SELECT YOUR DRINK' ENDIF IF n != sel THEN IF sel != 0 THEN BOX 30,13+(sel-1)*16,100,12+sel*16, 0 ENDIF IF n != 0 THEN BOX 30,13+(n-1)*16,100,12+n*16 ENDIF sel=n ENDIF IN=IN&15 TIME=0 FEND FUNCTION dispense() IF sel THEN IF sel==1 THEN OUT = OUT | 1 ENDIF IF sel==2 THEN OUT = OUT | 2 ENDIF IF sel==3 THEN OUT = OUT | 4 ENDIF TIME=0 WHILE TIME<1 out =" 0" in="IN&(255-8)" sold ="="" sold =" IN&7" cpms="ME" cmss="1',CR">



No comments:

Post a Comment