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

Search:

Type: Posts; User: Lorenzo

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Yes, exactly! 100% of the items have to meet...

    Yes, exactly!
    100% of the items have to meet the condition :)
  2. check ALL if the elements in an array meets a condition

    Hello forum,

    I am trying to check if ALL the elements of an array meets a condition.

    the pseudocode should be:

    if (all the elements in the array > value)
    {
    do something;
    }
  3. There was a problem inside my PID_Compute...

    There was a problem inside my PID_Compute function: I was uploading some global variables in a wrong way.
    I have built a void function that computes both PID controls inside it and now it works! :D
  4. Thank you Paul. Actually there are some more rows...

    Thank you Paul. Actually there are some more rows of code that are needed to send the signal to the motors.

    The problem is that the code works properly with only the first PID function (if I...
  5. two functions calls in the same intervalTimer

    Hi forum,

    Is it possible to call the same function two times in the same intervalTimer?

    I am trying to compute the same function with different input in an interval timer that runs at 1 kHz.
    ...
  6. Hi alisondmurray, I think you have copied and...

    Hi alisondmurray,

    I think you have copied and pasted my post from this link:

    https://forum.pjrc.com/threads/50538-lt-PID_v1-h-gt-myPID-Compute()-function-in-IntervalTimer-on-Teensy-3-5
  7. Hi everybody, I have implemented both the data...

    Hi everybody,
    I have implemented both the data acquisition and the writing on the SD card in the void loop (no more timers and interrupts) and I am able to save the data on the card at 1 kHz....
  8. Replies
    10
    Views
    1,005

    wow, thank you. I will try it! :)

    wow, thank you. I will try it! :)
  9. Replies
    10
    Views
    1,005

    Thank you very much for the help! Actually,...

    Thank you very much for the help!

    Actually, when I write in the buffer I can see the size of the buffer increasing from 0 to 8 but myBuffer.length_front() is always 0.

    This is my code:


    ...
  10. Replies
    10
    Views
    1,005

    I have a little trouble using Circular Buffer. ...

    I have a little trouble using Circular Buffer.

    I have initialize the buffer as follows:



    #include "circular_buffer.h"
    Circular_Buffer<byte, 8, 512> myBuffer;
  11. Replies
    10
    Views
    1,005

    Thank you for the suggestions. I will try to use...

    Thank you for the suggestions. I will try to use Circular Buffer!
  12. Replies
    10
    Views
    1,005

    QueueArray library max queue size

    Hello forum,

    I have a very quick question that I was not able to solve online.
    Which is the maximum default size of a queue in the Queue Array library? And how can I set a different size of the...
  13. Thank you every body for your precious help. I am...

    Thank you every body for your precious help. I am actually working on the code and I am trying to implement your suggestions.
    I will let you know any progress as soon as possible! :)
  14. You are right rcarr, thank you. I do not know how...

    You are right rcarr, thank you. I do not know how I could manage the transfer of data between different interrupts without using noInterrupts(), interrupts() ...
  15. Thank you all for the precious suggestions. I...

    Thank you all for the precious suggestions.
    I have modified the baud rate to 2000000, both T3.2 and T3.5 are working at 96 MHz, T3.2 sends data at 1 kHz (seems properly) and T3.5 tries to receive...
  16. Thank you for the suggestions, I will try to...

    Thank you for the suggestions, I will try to implement both the 4th start byte in the packet and a sort of state machine to read the incoming data.



    Actually, Teensy 3.2 works at 96 MHz whereas...
  17. Yes, I am sorry. I have tryed to make it a little...

    Yes, I am sorry. I have tryed to make it a little more comprehensible: 13419
    Thank you very much for your valuable help.
  18. Thank you very much. Yes, SERIAL_Incoming_Data....

    Thank you very much.
    Yes, SERIAL_Incoming_Data. is a union that collects the incoming data.
    In the code there are two more timers: one for the control of two motors and one for the writing on SD...
  19. Thank you Paul. Following your suggestions, I...

    Thank you Paul.
    Following your suggestions, I have moved the receiving part of the code in the void loop and implemented the check for the first three bytes.
    Now the baud rate is set to 230400 and...
  20. Thank you very much for the useful information...

    Thank you very much for the useful information and suggestions Paul.

    I have already implemented the function "checkPacket(SERIAL_Incoming_Data.vData)" that checks the start and the end of the...
  21. Do you mean setup the transmission in the main...

    Do you mean setup the transmission in the main loop and the receiving in SerialEvent()?
    How can I be sure about the transmission frequency in this case?
    Thank you
  22. Thank you for the interesting suggestions. The...

    Thank you for the interesting suggestions.
    The other SPI device is a Dual Encoder Breakout and I am using it to read two encoders at 2000 Hz (in an interval timer function). Then the encoder data...
  23. Is the problem due to the fact that the protocol...

    Is the problem due to the fact that the protocol is inside an interval timer?
  24. There could be something wrong in the code :) ...

    There could be something wrong in the code :)

    I have implemented the sending and receiving function inside an interval timer because I really need to send data at a specific frequency.


    This...
  25. Thank you for the suggestion. Unfortunately...

    Thank you for the suggestion.
    Unfortunately Teensy 3.2 has only one SPI port and I am already using it.
    I need to use a serial communication... Any suggestion on how to improve it?
    If you have...
  26. baudrate problem with teensy to teensy byte package communication

    Good evening forum!

    I am trying to send data from a Teensy 3.2 to a Teensy 3.5 through Serial communication.
    I am sending a 34 bytes package on Serial1 (to Serial1).
    The code for the T3.2 and...
  27. Replies
    6
    Views
    753

    Thank you for the suggestions. I have already...

    Thank you for the suggestions. I have already implemented a timer priority (highest priority for the "small" timer that control the motor and default priority for the timer reading data from serial...
  28. Replies
    2
    Views
    457

    It works with #pragma pack(push, 1) and #pragma...

    It works with #pragma pack(push, 1) and #pragma pack(pop) ! :D

    Thank you very much for the suggestion KurtE!
  29. myPID.Compute() function in IntervalTimer on Teensy 3.5

    Hi everybody,

    I am trying to use the library <PID_v1.h> in Teensy 3.5. In particular I would like to execute the myPID.Compute(); inside an IntervalTimer function at a frequency of 1 kHz. Inside...
  30. Replies
    2
    Views
    457

    problem with union in Teensy 3.5

    Hello forum!

    I have a little problem with an union in Teensy 3.5. I am sending binary data packages from a Teensy 3.2 to a Teensy 3.5 via Serial communication.
    I am using a union structure to...
  31. Replies
    6
    Views
    753

    Thank you GremlinWrangler. I will try for sure to...

    Thank you GremlinWrangler. I will try for sure to swap the array being written and write the old one.

    If I do not consider the SD card, is there a way to understand if my timers are really...
  32. Replies
    6
    Views
    753

    Thank you very much GremlinWrangler. I need...

    Thank you very much GremlinWrangler. I need deterministic writing in my code (1 kHz).
    If there is a way to easily write at 1 kHz in binary on the SD I would be grateful. Otherwise, could you give...
  33. Replies
    6
    Views
    753

    Hard real time in Teensy 3.5

    Hi everybody,

    I am developing a software on Teensy 3.5 in which I have implemented three different timers at 1 kHz.
    One of the timers should save data on a SD card. If I save the millis() at each...
  34. Thank you rcarr! I have solved the problem...

    Thank you rcarr!

    I have solved the problem with a TIP120 that I already had in the lab.
  35. Normally open transistor to control the inhibit of a driver from Teensy 3.5

    Hi everybody,

    I am using a driver Advanced Control Driver 12A8-QDI to control a DC motor from Teensy 3.5.
    I would like to control the inhibit pin of the driver to be sure that it is...
  36. Thank you very much Manitou, so maybe the problem...

    Thank you very much Manitou, so maybe the problem is not due to the PID function...
  37. PID library is blocking when the setpoint is reached

    Hi everybody,

    I am trying to control the speed of a DC motor with Teency 3.5 by reading data from the encoder.
    Everything seems working but, when the motor reaches the setpoint speed the...
  38. Thank you very much Theremingenieur!! :D :D This...

    Thank you very much Theremingenieur!! :D :D
    This solves my problem!

    I have added the following line at my code and the "begin" and "end" transactions lines:
    SPISettings setMAX532(2000000,...
  39. Replies
    9
    Views
    1,670

    Thank you very much turtle9er and WMXZ! :)

    Thank you very much turtle9er and WMXZ! :)
  40. Replies
    3
    Views
    750

    Sorry, could you explain it a little better and...

    Sorry, could you explain it a little better and post your code? Thank you.
  41. SPI communication with DAC MAX532 from Teency 3.5

    Hello forum,

    I am opening a new post about SPI communication with DAC since I am not able to solve the following problem since two weeks.

    I am trying to communicate with a DAC MAX 532 from...
  42. Replies
    2
    Views
    1,066

    delay in nanoseconds on Teency 3.5

    Hello everybody,

    Is there a way to add a delay in nanoseconds on Teency 3.5?
    I have tryed to search some examples but I could not find any.

    Thank you!

    :)
  43. Replies
    2
    Views
    640

    Enable and disable only one interrupt

    Good morning forum!

    I am trying to figure out how to enable and disable only one interrupt at a time on Teency 3.5, because by using "noInterrupts();" and "interrupts();" all the interrupts are...
  44. Replies
    9
    Views
    1,670

    I have one more question: Is there a way to...

    I have one more question:

    Is there a way to write binary data on the SD card without closing the file at the end of the writing?
    The opening and closing operations are becoming really...
  45. Replies
    9
    Views
    1,670

    Thank you very much WMXZ. I checked the file to...

    Thank you very much WMXZ.
    I checked the file to be opened and I have also implemented the closing of the file after a number of cycles.
    In the previous script also the storage of DataPackets in...
  46. Replies
    9
    Views
    1,670

    I have tryed the following code to write 512...

    I have tryed the following code to write 512 bytes on the SD card but there is no file on the SD card.
    The 512 bytes (SDPacket) are composed by 16 packets (dataPacket) of 30 bytes each.
    Why is it...
  47. Replies
    9
    Views
    1,670

    Thank you very much Paul. Tomorrow I will try it...

    Thank you very much Paul. Tomorrow I will try it on my Teency 3.5. :)

    I have just a little question:

    If I would like to write on the SD card 8 values (or more) which are acquired at each loop,...
  48. Replies
    9
    Views
    1,670

    writing binary file on SD card in Teency 3.5

    Hello forum!

    Where can I found a complete example on how to write a binary file on SD card in Teency 3.5?

    Thank you very much in advance,
    Lorenzo
  49. Replies
    3
    Views
    750

    Write data on SD card from Teency 3.5

    Hi everybody,

    I am trying to write data on a SD CARD SanDisk 16 GB U1 from Teency 3.5.
    I would like to log data from different sensors and I was wondering which is the maximum frequency for...
  50. Replies
    7
    Views
    1,482

    Thank you for your help Donziboy2. Now my DAC...

    Thank you for your help Donziboy2.

    Now my DAC MAX532 seems to work, the connections for the unipolar mode are as follows:


    Pin Connected to

    1 Shorted to 3
    2 10V (I used a KA78L05A linear...
Results 1 to 50 of 68
Page 1 of 2 1 2