Discussion forum for the BasicX family of microcontroller chips.
|
hi i was doing the example for get adc to read a thermister. my question is how do i see the value for the voltage or resistance on the screen.below is the code i compiled and ran. thank you jpm. Option Explicit dim voltage as integer const pinnumber as byte = 13 dim v as single Public Sub Main() voltage = getadc(13) call getadc(13, v) End Sub |
|
|
|
use the serialport.bas that is in the example section. define com1 then > Option Explicit > dim voltage as integer > const pinnumber as byte = 13 > dim v as single > Public Sub Main() > voltage = getadc(13) > call getadc(13, v) call putbyte(v) > End Sub --- jmayn2002 <> wrote: > hi i was doing the example for get adc to read a thermister. my > question is how do i see the value for the voltage or resistance on > the screen.below is the code i compiled and ran. thank you jpm. > > Option Explicit > dim voltage as integer > const pinnumber as byte = 13 > dim v as single > Public Sub Main() > voltage = getadc(13) > call getadc(13, v) > End Sub > __________________________________________________ |
|
|
|
tony thanks for the help, it took me a while to get the serialport.bas set up right. i am new to programing. i am still having trouble with the call putbyte(v). when i compile i get an error message that says type of actual parameter does not match that of formal parameter. thank you for the help. jpm. --- In basicx@y..., Tony Brenke <trbrenke@y...> wrote: > use the serialport.bas that is in the example section. > define com1 > then > > > Option Explicit > > dim voltage as integer > > const pinnumber as byte = 13 > > dim v as single > > Public Sub Main() > > voltage = getadc(13) > > call getadc(13, v) > call putbyte(v) > > End Sub > --- jmayn2002 <jmayn2002@y...> wrote: > > hi i was doing the example for get adc to read a thermister. my > > question is how do i see the value for the voltage or resistance on > > the screen.below is the code i compiled and ran. thank you jpm. > > > > > > > > Option Explicit > > dim voltage as integer > > const pinnumber as byte = 13 > > dim v as single > > Public Sub Main() > > voltage = getadc(13) > > call getadc(13, v) > > End Sub > > > > > > > > > > > > > > > > > > > > > > __________________________________________________ |
|
I don't believe you can use the " PutByte" command while trying to output
a Integer or Single. You'll have to either convert the V to a byte( depending your resolution) or use the "PutI" instead of PutByte... Hope it helps Stewart McCallum Sydney,Au ----- Original Message ----- From: jmayn2002 <> To: <> Sent: Tuesday, December 18, 2001 9:04 PM Subject: [BasicX] Re: reading a thermister > tony thanks for the help, it took me a while to get the serialport.bas > set up right. i am new to programing. i am still having trouble with > the call putbyte(v). when i compile i get an error message that says > type of actual parameter does not match that of formal parameter. > thank you for the help. jpm. > --- In basicx@y..., Tony Brenke <trbrenke@y...> wrote: > > use the serialport.bas that is in the example section. > > define com1 > > then > > > > > Option Explicit > > > dim voltage as integer > > > const pinnumber as byte = 13 > > > dim v as single > > > Public Sub Main() > > > voltage = getadc(13) > > > call getadc(13, v) > > call putbyte(v) > > > End Sub > > > > > > --- jmayn2002 <jmayn2002@y...> wrote: > > > hi i was doing the example for get adc to read a thermister. my > > > question is how do i see the value for the voltage or resistance > on > > > the screen.below is the code i compiled and ran. thank you jpm. > > > > > > > > > > > > Option Explicit > > > dim voltage as integer > > > const pinnumber as byte = 13 > > > dim v as single > > > Public Sub Main() > > > voltage = getadc(13) > > > call getadc(13, v) > > > End Sub > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > __________________________________________________ > |
|
I don't believe you can use the " PutByte" command while trying to output
a Integer or Single. You'll have to either convert the V to a byte( depending your resolution) or use the "PutI" instead of PutByte... Hope it helps Stewart McCallum Sydney,Au ----- Original Message ----- From: jmayn2002 <> To: <> Sent: Tuesday, December 18, 2001 9:04 PM Subject: [BasicX] Re: reading a thermister > tony thanks for the help, it took me a while to get the serialport.bas > set up right. i am new to programing. i am still having trouble with > the call putbyte(v). when i compile i get an error message that says > type of actual parameter does not match that of formal parameter. > thank you for the help. jpm. > --- In basicx@y..., Tony Brenke <trbrenke@y...> wrote: > > use the serialport.bas that is in the example section. > > define com1 > > then > > > > > Option Explicit > > > dim voltage as integer > > > const pinnumber as byte = 13 > > > dim v as single > > > Public Sub Main() > > > voltage = getadc(13) > > > call getadc(13, v) > > call putbyte(v) > > > End Sub > [Non-text portions of this message have been removed] |
|
|
|
use call puts(v) that will display a single. use call puti(v) that will display an integer. --- Stewart McCallum <> wrote: > I don't believe you can use the " PutByte" command while trying to output a > Integer or Single. You'll have to either convert the V to a byte( depending > your resolution) or use the "PutI" instead of PutByte... > > Hope it helps > > Stewart McCallum > Sydney,Au > > ----- Original Message ----- > From: jmayn2002 <> > To: <> > Sent: Tuesday, December 18, 2001 9:04 PM > Subject: [BasicX] Re: reading a thermister > > tony thanks for the help, it took me a while to get the serialport.bas > > set up right. i am new to programing. i am still having trouble with > > the call putbyte(v). when i compile i get an error message that says > > type of actual parameter does not match that of formal parameter. > > thank you for the help. jpm. > > --- In basicx@y..., Tony Brenke <trbrenke@y...> wrote: > > > use the serialport.bas that is in the example section. > > > define com1 > > > then > > > > > > > Option Explicit > > > > dim voltage as integer > > > > const pinnumber as byte = 13 > > > > dim v as single > > > > Public Sub Main() > > > > voltage = getadc(13) > > > > call getadc(13, v) > > > call putbyte(v) > > > > End Sub > > > > [Non-text portions of this message have been removed] > __________________________________________________ |
|
|
|
tony and stewart thank you for youre help. i used the puts(v) it worked great. thanks. jpm. --- In basicx@y..., Tony Brenke <trbrenke@y...> wrote: > use call puts(v) > that will display a single. > > use call puti(v) > that will display an integer. > > > --- Stewart McCallum <smccallum01@d...> wrote: > > I don't believe you can use the " PutByte" command while trying to output a > > Integer or Single. You'll have to either convert the V to a byte( depending > > your resolution) or use the "PutI" instead of PutByte... > > > > Hope it helps > > > > Stewart McCallum > > Sydney,Au > > > > ----- Original Message ----- > > From: jmayn2002 <jmayn2002@y...> > > To: <basicx@y...> > > Sent: Tuesday, December 18, 2001 9:04 PM > > Subject: [BasicX] Re: reading a thermister > > > > > > > tony thanks for the help, it took me a while to get the serialport.bas > > > set up right. i am new to programing. i am still having trouble with > > > the call putbyte(v). when i compile i get an error message that says > > > type of actual parameter does not match that of formal parameter. > > > thank you for the help. jpm. > > > --- In basicx@y..., Tony Brenke <trbrenke@y...> wrote: > > > > use the serialport.bas that is in the example section. > > > > define com1 > > > > then > > > > > > > > > Option Explicit > > > > > dim voltage as integer > > > > > const pinnumber as byte = 13 > > > > > dim v as single > > > > > Public Sub Main() > > > > > voltage = getadc(13) > > > > > call getadc(13, v) > > > > call putbyte(v) > > > > > End Sub > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > > > > > > > > > __________________________________________________ |