DIY Remote XBee - Going to Teensy 3.1

Kurt,
Its a whole lot cleaner. Iā€™m reading through the code looking and trying to understand the differences from the two and theyā€™re out comes.

Thanks for the eye opener.

Kurt
Installed Teensyduino 1.20 Release Candidate #2 and its all running fine.

Hi Again, Yes I am also using 1.20RC2. If you noted in his release notes, That version of ILI9341 is not the fast version, but back to the Adafruit version, with the SPI transaction stuff added.

Not sure if anyone else up here is interested in the SPI stuff, but Paul (Teensy) is working with the Arduino people to come up to a solution to deal with multiple SPI devices, which may run at different speeds and capabilitiesā€¦ The same issues I was running into with speeding up the ILI9341 and still using SPI library for touch display. Paul has this implemented in this RC, not sure how long until Arduino Integrates it for other platformsā€¦

But in the mean time Paul did take my faster version of the ILI9341, strip out all of the non Teensy 3x stuff, put in transaction stuff and is speeding up everything else. That is he brought in the Adafruit GFX code and is speeding it upā€¦

I have been trying it out, debugging it and the like and now have my stuff working with it. More details up at:
forum.pjrc.com/threads/26305-Hig ā€¦ 29-library

Kurt

Hi,
Just gave it a try. Had to make the modifications you posted on the pjrc forum. Seems to be working.
Philtkp_Screen_Test2e3a.ino (8.86 KB)

As you have already posted on pjrc, I know that you know he has fixed the driver to work with all of the current test programs and you no longer need my modifications :slight_smile:

Again you probably already know this, but he renamed the optimized library. I also retested with my modified version of your code, with the new library name and with all of my SPI switching hacks as this stuff is built into the new SPI codeā€¦
Philtkp_Screen_Test2e-140806a.zip (2.05 KB)

Thanks for letting me know. I just gave it a try. its nice having to add the SPI switches within the code

FYI - I have been playing around with the sped up version of the library, in particular the ability to read pixels back in. Finally had some success :slight_smile: Can now read in pixels and now can scroll parts of the screen. More details up on the thread: forum.pjrc.com/threads/26305-Hig ā€¦ #post53604

Note: I forked his version of it and my fork (with new stuff) is up at: github.com/PaulStoffregen/ILI9341_t3

Kurte,
this an off topic question. Just saw the intel Edison looks promising. was thinking of geting one. what do you think? sparkfun.com/products/13024

The Edison looks interesting, did not look today,but last I looked they only had the boards and not any supporting hardware.

Trossen with Intel and others is coming out with a homonoid robot that will have an Edison as well as a new board with an arm m3 processor to control it, which looks interesting

Everyone is on back order so I ordered sparkfun.com/products/13097 something to play with later

FYI - I ordered one of these today: newegg.com/Product/Product.a ā€¦ -_-Product

:slight_smile:

Thanks for letting me know.

FYI - I believe the new Intel board should arrive today,
I will probably post most of my observations up on the thread: forums.trossenrobotics.com/showt ā€¦ #post65428

And my guess is I will be asking questions up on the Intel Forum: communities.intel.com/community ā€¦ son/forums

hello Kurte,

I have modified your code to work on Arduino nano with HC05 and HC06. I trim it
I had a problem and made a change here otherwise nothing happened on the receiver. I donā€™t understand why =1 donā€™t work. no invalid packet but an errorā€¦

void SendXBeePacket(byte bPHType, byte cbExtra, byte *pbExtra)
{

abPH[3]=0x81;

remoteAndReceiver.zip (39.6 KB)

If you have the time, could you help me to debug keypad. The first row is not read and I would like to add ROWB as the previous remote. I can translate the receiver in basic for this part but on the remote to make an optimized code, it 's a problem

Also, I donā€™t undestand this part (what the micro does)
char ch = ā€˜0ā€™;
while ((w & 1) == 0) {
w>>= 1;
ch = (ch == ā€˜9ā€™)? ā€˜Aā€™ : (ch + 1);
}

what dot means as parameter in a function ( ,ā€¦ )

I have a keypad and the four buttons W,X,Y,Z I modified this part to match with row and colā€¦

itā€™s for puppy:

20191103_125658|483x460

Sorry it has be over 5 years ago since the last posting, and I donā€™t think I have looked at this code for about that long, nor have I done much at all with XBees in a very long time. So for example I donā€™t remember all of the details about what is required to send packets It would take someone to read over the XBee documents to see what format their packets are in, when they are switched into packet mode.
As for the code:

if (g_diyp.s.wButtons && !g_diypPrev.s.wButtons) {
            // not 100% good, but fine for test. 
            uint16_t w = g_diyp.s.wButtons;
            char ch = '0';
            while ((w & 1) == 0) {
              w>>= 1;
              ch = (ch == '9')? 'A' : (ch + 1);
            }
            //g_szButton[0] = ch;
            SSerial.println(ch);//SSerial.println(g_szButton);
            playSeq(ch);//BUGBUG
          }   

It is just a quick and dirty code to convert from which bit is set to a hex number:
Just walk the code through: if wButtons=0x01, the while loop will fail on the first iteration will fail and as such ch will be ā€˜0ā€™,

If it is 0x02, the loop while loop is not satisfied on first iteration, so ch -> ā€˜1ā€™ and w >>= 1 will now make w=1 so will exitā€¦

The only hack is suppose you pass in: 0b1000000000, it will loop on the first 9 trailing 0ā€™s and if it incremented the ASCII character that is ā€˜9ā€™, it would actually end up as, I think a ā€˜:ā€™, which is not what I wanted. So instead it detects that and instead sets the charater to 'A" instead. note if instead there was one more trailing 0, the increment would be fine as we wanted ā€˜Bā€™ā€¦ ā€˜Fā€™ā€¦

Not great but gets the job done!

*(,ā€¦) says variable number of arguments. You might do a query, example look at:
https://www.cprogramming.com/tutorial/lesson17.html

Oh - Nice to see you posting on the forum :slight_smile:

Hi @dialfonzo - yep from time to time. Maybe will be up here again more at some point if/when work on something with your newer servosā€¦

Right now mostly up on pjrc and Robotisā€¦

1 Like

thanks Kurte for your quick return.
//1000
//100
//10
//1
//> 4 Pressed

All works except the rowb :frowning:

Iā€™m working on a dog bot if you wantā€¦no ik. I simply failed to understand how to setup servo, and

//[START POSITIONS FEET]
#define cHexInitXZ 80
#define CHexInitXZCos60 40 // COS(60) = .5
#define CHexInitXZSin60 69 // sin(60) = .866
#define CHexInitY

Only 2 dof per leg but it do a headstand. He is in robots category on this forum