Parallax Propeller Manual Del Usuario página 222

Kit educativo
Tabla de contenido
Estudio de Soluciones
dac.start
repeat
debug.tx(">")
case menu := debug.rx
"C", "c":
debug.str(@_Channel)
channel := debug.getdec
debug.str(@_Pin)
dacPin := debug.getdec
debug.str(@_Resolution)
resolution := debug.getdec
dac.Config(channel, dacPin, resolution, @ch[channel])
"S", "s":
debug.str(@_Channel)
channel := debug.getdec
debug.str(@_Value)
ch[channel] := debug.getdec
"U", "u":
debug.str(@_Update)
case choice := debug.rx
"P", "p":
"B", "b":
"R", "r":
debug.str(@_Channel)
channel := debug.getdec
dac.Remove(channel)
debug.str(String(CRSRXY, 1,4, BKSPC, CLRDN))
DAT
_Menu
byte CLS, "C = Configure DAC", CR, "S = Set DAC Output", CR
byte "U = Update DAC Config", CR, "R = Remove DAC", CR, 0
_Channel
byte CR, "Channel (0/1) > ", 0
_Pin
byte "Pin > ", 0
_Resolution byte "Resolution (bits) > ", 0
_Value
byte "Value > ", 0
_Update
byte "Update Choices:", CR, "P = DAC Pin", CR,"B = Bits (resolution)"
byte CR, 0
Pagina 222 · Kit Educativo de Prácticas Propeller: Fundamentos
debug.str(@_Channel)
channel := debug.getdec
debug.str(@_Pin)
dacPin := debug.getdec
dac.update(channel, 0, dacPin)
debug.str(@_Channel)
channel := debug.getdec
debug.str(@_Resolution)
resolution := debug.getdec
dac.update(channel, 1, resolution)
Tabla de contenido
loading

Tabla de contenido