Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: laptophead

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Trying to organize 4 serial commands in 10 mS with machine State, but....

    Overview
    I run a robot with 8 motors connected to UARTs and RS485 convertors.
    I devoted 4 serial channels, 2 motors each.

    When I send a serial command, I need to wait about 2-3ms for the...
  2. Trouble with the uploads

    Every third time I upload, I get:

    An error occurred while uploading the sketch

    No other explanations, but the sketch is loading, and teensy reboots.

    I would ignore it, but My serial monitor...
  3. More trouble with the 4.1

    Every third time I upload, I get:

    An error occurred while uploading the sketch

    No other explanations, but the sketch is loading, and teensy reboots.

    I would ignore it, but My serial monitor...
  4. OK I will run it at 600 MHz, I got the power. I...

    OK
    I will run it at 600 MHz, I got the power. I never seen an Arduino compatible take that much,

    I thought it was bad, shorted inside...

    Thanks a lot.
  5. Upgrading from the 3.6 to 4.1 Power issues

    When I power the 4.1 from USB it is drawing 6 mA, thats reasonable.

    Then I put it in the socket I build, where the 3.6 was, I apply 5 v at Vin and Gnd and :
    It takes 106mA. I disconnected it...
  6. Trying to get rid of Delay in a for loop. Weird consequences :

    Better start with the code:


    static unsigned long _ETimer;
    unsigned long Period;
    #include "Keyboard.h"
    int StepNo;
    static unsigned int i;

    String Kbd_Str; // from keyboard string via...
  7. Actually I discovered that I can use float arrays...

    Actually I discovered that I can use float arrays as function arguments

    Problem solved, forget structs

    Thanks for your help.

    Mitch
  8. Ok I tried this typedef struct Way_Pt { ...

    Ok I tried this



    typedef struct Way_Pt {

    float M1;
    float M2;
    float M3;
    float M11;
  9. Trying to use a struct to simplify a function, please help

    Pardon my inexperience...

    I got this robot consisting of 8 motors and I am able to send commands to each of them by this function:


    void Ev_GoTo_Pos (float M1, float M2, float M3, float...
  10. Thanks a lot , that worked

    Thanks a lot , that worked
  11. How do I software reset the Teensy 3.6?

    I found the commands that supposedly work on the 4.0 but they do nothing for the 3.6.

    I am triggering the reset by a serial command



    if (Serial5.available()) { // Read intstructions from...
  12. I got the library from Sparkfun to work and give...

    I got the library from Sparkfun to work and give me the Yaw, Pitch, Roll:

    If you need it here it is, nice and stable .


    /* MPU9250 Basic Example Code
    by: Kris Winer
    date: April 1, 2014
    ...
  13. Sebastian Thanks a lot, I will explore the...

    Sebastian

    Thanks a lot, I will explore the IntervalTimer.h

    Here
  14. My longest string looks like this 94 lenght...

    My longest string looks like this
    94 lenght
    M.Curr: M1:1.6A 0.7A 0.5A 0.0A B: M11:1.8A 0.2A 0.2A 0.0A, Volts:15.8A 4.9A Total,

    so you're right Sebastian, it is longer than 40.

    So I...
  15. never mind , I figured it. Silly me. I had a...

    never mind , I figured it. Silly me. I had a long day, sorry.

    for everyone:

    Serial5.printf( "%s Step: %d Compl A: %d Compl B: %d Send Once:%d First: %c Show Gaps:%d \n",
    ...
  16. Dear defragster The ISR is rarely used, it is...

    Dear defragster

    The ISR is rarely used, it is a switch that I flip sometimes. The blocking happens regardless...

    Kurt

    I tried Serial5.printf but it won't print out on ser 5 . it works for...
  17. It seems that sprinf is a blocking function? what to do?

    I am building a robot with 8 motors and I am sending to a PC where I have a GUI all kind of data. 112500 baud,

    8 encoders, 8 current readings and some other variables. I was counting on my 3.6 to...
  18. Maybe is easier to just use the MPU6150? It...

    Maybe is easier to just use the MPU6150? It seems that it provides my angles without all the trouble.

    right now I am using the https://github.com/bolderflight/MPU9250. library

    Is there a...
  19. How do I get the angle out of the MPU9250?

    I installed it and connected it to the IC2 and all seems fine.

    I tought the IMU.getGyroX_rads() will give me the angle, (inclination) of the IMU, but instead I get angular acceleration,

    I moved...
  20. Actually that was it. The pulses vary based on...

    Actually that was it. The pulses vary based on single turn or multi turn...

    For multi turn, this is the correct formula, in case others need it

    long Enc_2 = Enc_Read_2;
    Mot_Ang_Read...
  21. The Bitshift

    I am reading this fancy encoder sending me a Hex string, see attach link from the manufacturer.
    http://dow.gyems.cn/RMD-servo%20motor%20control%20protocol%20(RS485%29%20V1.6.pdf

    I am trying to...
  22. Thanks a lot, I will try

    Thanks a lot, I will try
  23. Is "split" a valid command for a string?

    I does show in red in the IDE , so it does exists, but I get a
    'class String' has no member named 'split'

    Long story short, I am trying to extract values (Floats) from a string based on the...
  24. A[11]), was the mistake, thanks every one. ...

    A[11]), was the mistake, thanks every one.

    Embarrassingly simple, sorry for the trouble.

    Paul:
    For the future I will post more definitions and code. In this case the data comes from a motor...
  25. sprintf is not running correctly on my 3.6, Thanks.

    Greetings community,

    I just learned to use sprintf and what a blessing, I am saving on tone of code.

    Here is a function I am trying to simplify, lots of data, I included the "old way" and the...
  26. Paul, I figured it , thanks for your help. ...

    Paul,

    I figured it , thanks for your help.


    if (Serial1.available()) {

    uint8_t b = Serial1.read(); // always read the next incoming byte
    if (b == 0x3E) {
    num_received =...
  27. Paul Thanks so much, your advice makes a lot of...

    Paul
    Thanks so much, your advice makes a lot of sense.

    I implemented your code and I am doing a printout. I used a flipping bool in order to print just once


    if (Serial1.available()) {
    ...
  28. VJ I implemented the uint16_t...

    VJ
    I implemented the
    uint16_t data_checksum_temp = 0;

    But still no reading from the last if,
    By the way, I am running at (115200). Is that relevant?

    We still have a bug?
  29. VJ Thanks a lot, so elaborate... So I tried...

    VJ
    Thanks a lot, so elaborate...

    So I tried to put it to work:


    while (Serial1.available()){
    uint8_t head = Serial1.read(); //Read one byte
    uint8_t command;
    uint8_t id;
  30. Still, How do I solve my problem? How to I...

    Still, How do I solve my problem?
    How to I receive transmissions of various lengths?

    I tried just receiving the first 7 bytes. Worked fine for the first transmission , then the second...
  31. Pete, I have a lot more than seven bytes in my...

    Pete,

    I have a lot more than seven bytes in my example, so is the fourth byte accurate? I don't see how.

    So what to do?
    read the 4 bytes always, and then how do I read the remaining bytes?
  32. thanks everyone, Changing the while to if did...

    thanks everyone,

    Changing the while to if did not work.

    The motor data sheet is at
    http://dow.gyems.cn/RMD-servo%20motor%20control%20protocol%20(RS485%29%20V1.6.pdf

    Here is a sample...
  33. How to read bytes transmissions of various lengths ?

    Using Teensy 3.5 Serial1. Are all the Serial ports buffered? Is there an advantage in using 1,2.3 or another?

    I am talking to motor with a built in encoder. I am sending commands and the motor...
  34. Kurt Thanks a lot. About Serial4 writing out, I...

    Kurt
    Thanks a lot. About Serial4 writing out, I reduced the size of the string I am sending, and I think is not blocking anymore.
    I don't see the blockage on the scope like before.
    However, it...
  35. Thank you everyone, Me writing a new library...

    Thank you everyone,

    Me writing a new library for Roboclaw? Way beyond my abilities.
    I will have to live with it. Would implementing the new teensy 4.0 help? Probably not.


    Second issue:...
  36. Kurt, Thanks for the detailed explanation. ...

    Kurt,
    Thanks for the detailed explanation.
    I think this is as good as it gets. I can call the read every 10 ms and that means I refresh 100 times a sec.
    I heard that a guided mislle...
  37. Thanks for the reply, Yes the roboclaw is now...

    Thanks for the reply,

    Yes the roboclaw is now basic micro
    https://www.basicmicro.com/downloads

    Yes, I am sending commands to be finished by the controller, but I have to know when they are...
  38. Is Teensy Blocking during Serial communication?

    I am using a 3.5 to run a robotic arm, 6 points of inflection, controlled by 3 DC motor controller with Quadrature encoders.

    It is essential to read the encoders all the time, so I know my XYZ...
  39. Replies
    2
    Views
    220

    Yes, that worked easily Thanks a lot Mitch

    Yes, that worked easily

    Thanks a lot
    Mitch
  40. Replies
    2
    Views
    220

    Can my Teensy 3.5 come back to life?

    I unplugged the USB in the middle of a long sketch upload. I had to.
    The teensy is running a robot arm and it went berserk...

    After recovery, the Teensy USB port is not even seen on my Mac

    On...
  41. Thanks a lot, I wish the Arduino website was...

    Thanks a lot, I wish the Arduino website was correct,

    The show:
    Example Code
    int a = 50;
    int b = 10;
    int c = 0;
    c = a / b; // the variable 'c' gets a value of 5 after this statement is...
  42. This is embarrassing, but I can't do division ?!?!

    according to Arduino website 2 integers can be divided.

    So I tried

    int a =33;
    int b =55;


    void setup() {
  43. Replies
    5
    Views
    339

    Thanks everyone fmod worked really nice ...

    Thanks everyone
    fmod worked really nice

    new_Th= fmod (new_Th,90); // first is the Number and second is the Factor

    I did not have to ad any library, just added

    #include "math.h". at the...
  44. Replies
    5
    Views
    339

    I defined them as doubles, but was impossible to...

    I defined them as doubles, but was impossible to convert from string.

    I also tried define them as Floats, but the modulo operand did not work.

    TNKS
  45. Replies
    5
    Views
    339

    String toDouble not working on Teensy?

    Is that true?

    I tried newX = newX_St.toDouble(); and I got a "No class member toDouble"

    Too bad I need the precision,

    I tried the next best thing, ToFloat and it works.
    BUT:

    I can...
  46. Replies
    9
    Views
    2,162

    Paul, Please I still need your help

    While using the TimeLib, I built a equation to transform the current time in elapsed seconds.

    ElapsedSeconds = (hour() * 3600) + (minute() * 60) + (second());

    I never get past 24 hrs. The...
  47. Replies
    9
    Views
    2,162

    is working on any arduino, I was...

    <TimeLib.h> is working on any arduino, I was hoping to get some help here.
    I am a fan of Teensy and I use it any time I can, but this TFT requires Mega.
    This forum generally provides much...
  48. Replies
    9
    Views
    2,162

    Monseur Ingineur, Merci beaucoup, However I...

    Monseur Ingineur,

    Merci beaucoup,

    However I am running all this on a Mega . The TFT plugs easily on a mega.

    IntervalTimer myTick; does not compile. Any ideas?

    to tell you more of...
  49. Replies
    9
    Views
    2,162

    Trying to customise

    I am putting together a downtime tracking device for an industrial application.

    THe time is arbitrary and it starts with the reset button or powering up. TimeLib.h does a nice job to avoid...
  50. It is me again. After re-booting a couple of...

    It is me again.
    After re-booting a couple of times and using a different USB cable, the problem went away.

    The correct port shows, and it uploads and Serial Prints fine...

    Go figure

    Thanks
Results 1 to 50 of 96
Page 1 of 2 1 2