Hi using the nrf24e1, in the datasheet it says to set a pin on a particular port to an input or output for example port 0 pin 1 to output:
P0_DIR.1 = 0;
but this doesnt seem to be recognised in keil. what is the correct code for this?
cheers.
0x01 = 1<<0 = 1 = bit 0 (least significant bit) 0x02 = 1<<1 = 2 = bit 1 0x04 = 1<<2 = 4 = bit 2 0x08 = 1<<3 = 8 = bit 3 0x10 = 1<<4 = 16 = bit 4 0x20 = 1<<5 = 32 = bit 5 0x40 = 1<<6 = 64 = bit 6 0x80 = 1<<7 = 128 = bit 7 (most significant bit)
ahh ok, i see, well i what i want to do is to set P0.5 as an input and to only transmit when a pulse is received on that pin, i have set pulse_pin (p0.5) as an input using the above, along with p0.1 for other reasons.
i.e. P0_DIR = 0x22;
in init() function i have set pulse_pin = 0 then the code for main() is as follows:
if (pulse_pin = 1) { transmitter() }
is this the correct way of 'asking' if a pulse is received, i.e. goes high from a voltage.
thanks again