My elder sister's son is 5 yr old and he is pretty good at breaking things




If not what is best way to achieve this ?
Thanks
Code: Select all
void setup()
{
SPI_DIR = ( CE + SCK + CSN + MOSI);
SPI_DIR &=~( IRQ + MISO);
Serial.begin(9600);
init_io();
TX_Mode();
}
void loop()
{
unsigned char status=0;
unsigned char key=0;
for(;;)
{
tx_buf[1]=key;
key++;
status=SPI_Read(STATUS);
if(status&TX_DS)
{
SPI_RW_Reg(FLUSH_TX,0);
Serial.println(tx_buf[1],HEX);
SPI_Write_Buf(WR_TX_PLOAD,tx_buf,TX_PLOAD_WIDTH);
}
SPI_RW_Reg(WRITE_REG+STATUS,status);
delay(1000);
}
}
Code: Select all
void setup()
{
SPI_DIR = ( CE + SCK + CSN + MOSI);
SPI_DIR&=~ ( IRQ + MISO);
Serial.begin(9600);
init_io();
RX_Mode();
}
void loop()
{
unsigned char status=0;
unsigned char key=0;
for(;;)
{
tx_buf[1]=key;
key++;
status=SPI_Read(STATUS);
if(status&TX_DS)
{
SPI_RW_Reg(FLUSH_TX,0);
Serial.println(tx_buf[1],HEX);
SPI_Write_Buf(WR_TX_PLOAD,tx_buf,TX_PLOAD_WIDTH);
}
SPI_RW_Reg(WRITE_REG+STATUS,status);// clear RX_DR or TX_DS or MAX_RT interrupt flag
delay(1000);
}
}
Saman wrote:I agree with Shane. I have another idea. How if you buy a R/C toy (car, boat, etc...) for about LKR 500 (US$ 5) and modify the circuit for your need?
Guess it will make things complicated. It would require a DAC and a ADC on both sides (if two way communication is required) which will increase the cost. All-in-one ICs are common these days. These ICs have both DAC and ADC built-in in addition to the transceiver. I guess Rksk is clear on the point now. Even if we establish a radio link, there should be a way to send signals from one end to the other. This is where we need to spend some more money on doing DAC and then ADC. If it is me, I would get this approach since making things is more fun than buying things for an engineer.I have suggested to buy a small fm microphone (LKR100) and a FM reciver circuit (LKR200). You can tune them and use with a areal.
What you are saying has a point. Why not we play with this onethere is no anything to do, just play with new toy