Impreza code

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #3459
    Christoffer
    Participant

    Hi,

    I am working on a little project to “hack” an RC car and control it with Arduinos.

    I am trying to use an Arduino Uno with the joystick shield and NRF24L01 and the RC Basic Controller code together with and identical hardware setup but with the Impreza code just to test if I can get a connection between working.
    From what I can understand I can cycle through different vehicle IDs using the E button on the joystick (and the Impreza code is set to 20 by default).
    However, I can’t seem to get it to work.
    Am I missing something here? Is there something I need to change in the code to get it to work?
    I am using the most recent code from the site.

    Just as a side note, I have tried the hardware setup with some of the example code that comes with the RF24 library and that works, so the hardware is working.

    #3460
    RC Tractor Guy
    Keymaster

    Hi Christoffer, if I remember correctly the basic controller code only cycles from 1 to 5 so I’d try setting the ID in the Impreza code to 1 and it should work without needing to push the e button I think. They are only at such big numbers because I have so many models now, I don’t think it effects the code anywhere else so it doesn’t matter what ID number you give it.

    #3461
    Christoffer
    Participant

    Thank you very much, that does appear to work!

    Another thing. I have connected both devices to my laptop in order to be able to read what is going on through Serial. It seems to take quite a long time before they connect. I have added a few printouts for when radio is available and when the correct vehicle id has been “confirmed” on the receiver end.
    If I start both up at the same time and wait for them to connect it can take more than a minute before they connect, and even then it takes a long time between each time I get a “confirmed vehicle id” which I would assume should be confirmed for each “sent message” between the devices.
    Note that I am not really doing anything with them at this point. Not using the controls for anything. But I have tried pushing some buttons and moving the joystick and that does not appear to make a difference.

    Any ideas on why this might be?

    I have set radio.setPALevel to MAX for the controller.

    Thanks again for the quick reply before. Been “banging my head against the wall” all day with this 🙂

    #3472
    RC Tractor Guy
    Keymaster

    That is strange, if you move the controls does it send faster? I might have made it so that it only sends data when required so that there was minimal interference between models and controllers but I can’t really remember at the minute. When I power up my model, I immediately see the connection indicator flash up on the controller screen so it is definitely not normal.

    #3473
    Christoffer
    Participant

    From what I can see it makes no difference if I move the controls or not.
    In the serial monitor I get the empty <> for a while, then after a seemingly random amount of time I get a printed message about the radio being available. Then it will continue giving med <> for a while until the same message appears again or I get the Confirmed vehicle ID printout.

    My suspicion was that it might be my laptop (wifi/bt) that blocks the signal a bit, but I need the computer to see the printouts.

    I will try to connect a DC motor with a motor controller to the default pin on the Arduino and see if that works.

    This is way trickier than I would have thought…

    #3505
    RC Tractor Guy
    Keymaster

    Hi Christoffer, did you ever solve your problem?

    #3517
    Christoffer
    Participant

    Hi,
    No not really. I did some additional testing, but recently I haven’t had time to work on it.
    I might look into to again eventually. It would be fun to solve it 😉

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.