Re: [bascom] variable in &H
Whell what i want to do is this. I am making a RTC with a DS1306 (SPI) And i
made it so that you can set the time and date through 2 buttons. 1 is incr
and the other is execute.
But my problem now is, when I send a byte in &H16 (for hours so 4 oclock)
then the RTC sees 16:00:00 (i only send hour byte for now) But when i send
16 (decimaal form) it sees 10. So i have to send it in hex for. But when i
increment my hours variable then the number is set to decimaal and not &H,
so i want to convert it so I can send it in hex form.
maybe there is another way, so help is appreciated
thanks
Guy
----- Original Message -----
From: "ian dobson" <i.dobson@planet-ian.com>
To: <bascom@grote.net>
Sent: Sunday, March 14, 2004 8:06 PM
Subject: Re: [bascom] variable in &H
> Hi,
>
> The text &h tells bascom that the value is in HEX.
>
> If you want to define an array use the command:-
>
> dim a(10) as byte 'This will create an array with 10 elements
>
> then you can do
> a(1) = &h1a 'Set element 1 in array to 1a hex
> a(2) = &h80 'Set element 2 in array to 80 hex
>
> On the other hand if you want to convert a hex string to number use the
> command HEXVAL.
>
>
> Regards
> Ian Dobson
>
>
> ----- Original Message -----
> From: "Guy Ubaghs" <guy_ubaghs@hotmail.com>
> To: "bascom forum" <bascom@grote.net>
> Sent: Sunday, March 14, 2004 7:53 PM
> Subject: [bascom] variable in &H
>
>
> > hi
> >
> > i want to put a variable into &H.. can this be done. Normaly x = &h80
now
> i
> > want x = &H(y)
> >
> > i tried this but it doesnt work, anyone suggestions?
> >
> > thanks
> >
> > Guy
> >
>
>