Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
shift left
The << operator shifts the binary representation to the left, dropping the most significant bits and appending it with zero bits. The result is equivalent to multiplying the integer by a power of two.
if you start with
x = 0b00000001
and do
x = x << 1
x will be 0b00000010
you can also shift by more then one bit
x = x << 3
will shift 3 bit positions
'============================== Pin definitions ==============
toneout var PORTA.1
s1 var PORTB.0
s2 var PORTB.1
s3 var PORTB.2
s4 var PORTB.3
s5 var PORTA.2
s6 var PORTA.3
e var PORTA.4
'TX is fixed at MCLR
'============================ variables ======================
tnum var Byte ;tone number from radio
frec var Word ;tone frequency x 5
Define osc 20 ;trick compiler into thinking the crystal is 20mhz, To get better freq resolution.
CMCON = 7 ;Disable comparators, Enable digital functions On PORTA
'=============Main============
toneoff: If e = 0 Then Goto toneoff ;tones are disabled, just idle
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.