We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, can anyone tell me how i would set up a variable that expects a certain amount of data to be received through rs232.
i.e. to receive 18 bytes of data only once the the rx pin has been set to input.
thanks guys
Hi well this is the code i have atm for the transmitter:
void TRANSMITTER(void) { unsigned char Mode; unsigned char b; unsigned char Packet; unsigned int address; if (Mode == 'd') { Packet = GetChar(); Configuration(); DELAY_100us(200); for(b=0;b<txconf.n;b++) { SPI_ReadWrite(txconf.buf[b]); } Standby(); DELAY_100us(200); for (address=0x00;address<0xff;address++) { EEWrite(address,Packet); } for (Packet=0;Packet<18;Packet++) { TRANSMIT_Packet(Packet); } } }
if (Mode == 'd') is just for the pulse pin i have set up to ensure the data to be received is data and not a command as can be seen i have set up an unsigned char Packet and i am using Packet = GetChar(); to retreive the byte.....if i remove the GetChar() how can i assign the byte received to Packet to ensure that byte is sent, further down the code?
Cheers Rhys
can someone please analyse this code? thanks
can someone please analyse this code
HOW?
what does packet() do ? what does configuration() do: ? why do you indent 'a mile' use spaces, not table?
Erik
PS: you have two options a) wait till it may be convenient for a responder if you want it for free OR b) pay for it.
Do you really think there are people sitting around just waiting to solce your problem for free?
"can someone please analyse this code?"
For a start, you need to fix the layout (indentation) - it's all over the place!
Use spaces - do not use TABs.
You know where you are with spaces, but the interpretation of TABs is entirely at the whim of the displaying application and/or device and its/their particular configuration(s)!
And use the 'Preview' before posting to verify that it's OK.
Well as you seem to respond to most posts i am presuming you are forum moderators employed by keil?? if not then i am truly greatful for your help. the configuration() etc just set up the nrf24e1 CS and CE, and in response to Dan, we are not the same person but are working on the same project......im not that immature.