Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Flying a drone with RC commands from a Teensy - anyone done this? Need help.

  1. #1

    Flying a drone with RC commands from a Teensy - anyone done this? Need help.

    There is a project with code that supplies RC control commands to drones from an NRF24L01 here:
    https://github.com/goebish/nrf24_multipro

    I want to be able to use a Teensy 4.1 to run it, but the project is based on an Arduino Uno and software SPI.

    There are already a lot of compatibility issues with the drones themselves, and now there is the added mess of the hardware port.

    Questions:
    1. Any best practices regarding switching to hardware SPI on Teensy?
    2. Has anyone ever used this code base before on an Uno?
    3. Has anyone ever tried to use this code base with a Teensy?

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,350
    Search forum for NRF24L01 (or RadioHead )- seems there was recent work on RadioHead library to update and hopefully work on Teensy.

    This links to the updated code :: Teensy-4-x-gt-Teensy-4-x-communication-usion-NRFL2401

    But is not the thread where the work was done.

  3. #3
    I put some more work into converting the project below for compatibility with Teensy 4x.

    It is made for Arduino Uno and uses both RF24 and bitbanging for SPI communication with an NRF24L01. The RF24 portion is working with Teensy4.1, but I haven't been able to substitute the hardware SPI calls into the package such that they work with the NRFL2401.

    Many of the calls to the NRF2401 that are executed by the package using the included softspi module, can be substituted with calls from the RF24 module, but not all. The calls that use the softspi module cover the protected member functions of the RF24 module. I can't substitute in protected member functions without going to the trouble of including my own modified version. Any advice on how to proceed?

    I suspect that the softspi functions in the package can be adjusted with Teensy-compatible SPI calls very easily for a quick and dirty solution. However, presently, I'm not doing it right. I'm betting a resident expert here can modify this portion easily such that the rest of the calls in the module to softspi functions end up calling hardware SPI functions that work with teensy units. I'm thinking its only a few lines...but again, I'm not doing it right.

    Here's the module:
    https://milankragujevic.com/controli...on-and-arduino

  4. #4
    I adjusted the RF24 code to make the private functions public. I was then able to substitute all the RF24 calls in and see my drone bind using a Teensy 4.1.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •