Zohan / ArduinoCC2500Demo

A demo of the Arduino communicating with a CC2500
10 stars 5 forks source link

RC car #2

Open giubu opened 3 years ago

giubu commented 3 years ago

Hi there, I am trying to set up a transmitter receiver with your library. what would be the appropriate way to send potentiometer values over 2 cc2500 and pro micro? sorry, but I am not familiar with packet send. thank you in advance

Zohan commented 3 years ago

To send a potentiometer value, you would analogRead the pot, then put it into the packet using the sendPacket function in the .ino. You change the packet information starting on line 100. Note that the first byte in the packet, packet[0], must equal the length of the packet.

giubu commented 3 years ago

hi there, thank you so much for the reply. I am actually having other kinds of problems... when I upload your code I get a continuous stream of Transmitting Finished sending I have uploaded your code to two arduino pro micro. they run at 5V and the cc2500 are powered with an external battery. if I take power away from arduinos, the power led on them stays dimly lit. Could you give me your insight on what it's actually happening?

Zohan commented 3 years ago

A single CC2500 cannot send and receive packets at the same time. The demo code flips from transmit to receive every 400ms, but it doesn't guarantee that the packets will be received.

Based on how you intend to use this, you will have the Arduino on the car as the receiver, and the other Arduino as a transmitter. It'd make the most sense to reprogram the Arduino on the car to only listen for packets. The simplest way to do this is to upload the code as-is to the transmitter Arduino, then comment lines 46-50 and upload the modified code to the Car Arduino.

giubu commented 3 years ago

ok, I've tried that, I get some 3 zeros on monitor, then nothing else. on both arduinos the receiving led is constantly lit. Can it be a problem related to different voltages on the I/O?

Also I should mention I get the following error when compiling

Invalid library found in /home/boombox/Arduino/libraries/Arduino-CC2500-Library-master: no headers files (.h) found in /home/boombox/Arduino/libraries/Arduino-CC2500-Library-master

giubu commented 3 years ago

So, after a little messing around i now get a constant stream of zeros, which I understand is the packet length, which should be six. any ideas why?

Zohan commented 3 years ago
  1. After it says initializing wireless, you should receive 3 numbers before it goes into the main loop. What are those numbers?
  2. Check to make sure your registers are being written. ReadReg and Read_Config_Regs will help you here.
  3. All I/O voltages need to be the same, and the CC2500 is only rated for a max of 3.9v, not 5v (datasheet). If you're using an external LiPo, recommend you discharge it to below 3.9 (recommend 3.7).
  4. The CC2500 is a very low-level, very advanced wireless module. In my experience they are very fickle, requiring a lot of trial and error to get working your first time. If you don't need all the configuration features (like selecting between 2-FSK and OOK, or defining preamble lengths), or all of the extra information you receive (like RSSI, LQI, etc.), then I would recommend switching to Nordic's nRF24L01. They're much easier to work with.
gdog9093 commented 3 years ago

Where does GDO0 go? on the Arduino and did u guys get this to work

gdog9093 commented 3 years ago

im getting 661 as my first three numbers

Zohan commented 3 years ago

Where does GDO0 go? on the Arduino

First off, in this example code GDO0 is not used (it's an optional feature), so you don't need to connect it. You control the CC2500 through GDO1 (SO). With that said, you connect GDO0 to any GPIO pin on the Arduino.

im getting 661 as my first three numbers

661 is correct. Your microcontroller is successfully talking to the CC2500 module. Transmitting/Receiving packets is the next challenge for you.