conversion from picbasic to picbasic pro

# Thread: conversion from picbasic to picbasic pro

1. ## conversion from picbasic to picbasic pro

Hello,

i was wondering if somone could help me with this code:
Code:
```OntvangBitAantal:             ;Vul het ontvangstbyte met het opgegeven aantal bits in BCD mode
OntvangByte = 0
FOR BD1 = 0 TO BitAantal - 1
GOSUB OntvangEenBit
'IF OntvangBit = 1 THEN  SETBIT OntvangByte,BD1
IF OntvangBit = 1 THEN  OntvangByte,0(BD1)=1
endif
NEXT
OntvangByte = ((OntvangByte >> 4) * 10) + (OntvangByte & 15) ;BCD (Binary-Coded Decimal) naar byte conversie
RETURN

OntvangEenBit:                ;Ontvang een bit en bewaar dit in OntvangBit

WHILE DCF_Signaal = 0
wend
ontvangbit=bitwaarde
dcf_signaal = 0
return```
the problem is this line:
Code:
`'IF OntvangBit = 1 THEN  SETBIT OntvangByte,BD1`
it is for picbasic and not picbasic pro
what function do i need in picbasic pro

note this is a routine for putting bits in a byte that are recieved from an antenna, one bit every second

all help is welcome

2. Did you find this post helpful? |

## Re: conversion from picbasic to picbasic pro

Hi,
If OntvangByte is a byte (or word or long) you access its indivudal bits using the dot notation, like:
Code:
```OntvangenByte.0 = 1  'Set bit 0
OntvangenByte.7 = 0  'Set bit 7

If Ontvangbit = 1 THEN   ' If bit is set
OntvangByte.0 = 1       ' Set lowest significant bit in BYTE
ENDIF```
/Henrik.

3. Did you find this post helpful? |

## Re: conversion from picbasic to picbasic pro

Henrik,

many Thanks

Problem solved ! i used the , instead of the .

IF OntvangBit = 1 THEN OntvangByte.0(bd1)=1
thanks again