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

Search:

Type: Posts; User: frankzappa

Page 1 of 3 1 2 3

Search: Search took 0.00 seconds.

  1. Replies
    22
    Views
    476

    It's working great, this has been really helpful....

    It's working great, this has been really helpful. I love this forum, hugs to luni and KurtE :D
  2. Replies
    22
    Views
    476

    Circular_Buffer buffers[10]; Is...

    Circular_Buffer<float, 1024> buffers[10];

    Is "1024" the number of slots in the buffer or the total size in bytes?
  3. Replies
    22
    Views
    476

    Great, thanks :)

    Great, thanks :)
  4. Replies
    22
    Views
    476

    Yes I know how a ring buffer works but now I...

    Yes I know how a ring buffer works but now I realise what the setup code does, thanks.

    Another question, is the ring buffer library inside the arduino IDE or do I have to download it?

    I can't...
  5. Replies
    22
    Views
    476

    BTW: buffers[index].write(newValue); ...

    BTW:



    buffers[index].write(newValue);
    return buffers[index].read();


    .write() writes to the first index of the buffer and pushes back all the other values and .read() reads the...
  6. Replies
    22
    Views
    476

    I'm sure it's simple but for me I really needed a...

    I'm sure it's simple but for me I really needed a simple example because the examples on github are not really for beginners. They require a lot of C++ knowledge to understand. I only know some C :P...
  7. Replies
    22
    Views
    476

    Excellent, I think this will work.

    Excellent, I think this will work.
  8. Replies
    22
    Views
    476

    Well since I'm doing all the code between sensor...

    Well since I'm doing all the code between sensor readings (I start a new reading and then do calculations on the previous sensor pair while the new readings are converting) I don't actually need to...
  9. Replies
    22
    Views
    476

    I'm not really getting this part: // prepare...

    I'm not really getting this part:


    // prepare the buffers with dummy data to have the read pointer delta steps before the write pointer
    for (unsigned i = 0; i < delta; i++)
    {
    ...
  10. Replies
    22
    Views
    476

    Thanks, I'll implement this into my code :) I...

    Thanks, I'll implement this into my code :)

    I have the 600kHz readings sorted and I've already made it work great, was not easy to figure everything out though, got help here on this forum :)
  11. Replies
    22
    Views
    476

    Thanks for the code, the question is how to do...

    Thanks for the code, the question is how to do this for multiple sensors, also I need it to run as fast as possible. I have 10 sensors, all updated 600 times per millisecond and I need to run...
  12. Replies
    22
    Views
    476

    I've looked at it and it's too damn complicated...

    I've looked at it and it's too damn complicated for me right now. Seems like it would take weeks for me to learn to use the thing. I'll have to read hundreds of lines of code to do something that...
  13. Replies
    22
    Views
    476

    How to add a delay to an analog read?

    Hello, I'm reading analog sensors and want to make delayed versions of it in a set number of milliseconds or samples.

    I'm thinking something like this:




    out = delayBuffer[i];
    ...
  14. I've gone the chaotic experimental way but also...

    I've gone the chaotic experimental way but also slightly academic. The best course I've found is Neso Academy youtube video course on C, you will not find a better course on any topic anywhere. This...
  15. Replies
    4
    Views
    249

    Well I'm making an electronic drum. What I...

    Well I'm making an electronic drum.

    What I really want to do is separate the real peaks from aftershocks.

    I have a program that tracks peaks fairly accurately and it sets the threshold to decay...
  16. Replies
    4
    Views
    249

    Store values for a period of time.

    I need help with a solution to a problem.

    I want to store some calculations of sensor values (peaks etc.) for a period of time say 2 milliseconds and when that peak "expires" I want to store it...
  17. Yeah I'm aware of that and it's not something I...

    Yeah I'm aware of that and it's not something I can control. All I can do is to try send them at once and cross my fingers that the recieving side will process it as three simultaneous hits.
  18. I'm not sure what you mean by table. The log...

    I'm not sure what you mean by table. The log thing is unrelated to the original question of sensor values to indexes of a 2D array.

    I need to convert 1006 - 2500 from linear to logarithmic...
  19. I have a sensor that I peak track. I get values...

    I have a sensor that I peak track. I get values from about 1006.0f to about 2500.0f. I want to make that range logarithmic so it converts from 1006 to 2500 to 1-127 but the lower/mid values rise...
  20. Thanks, much appreciated. I'm guessing it's the...

    Thanks, much appreciated. I'm guessing it's the ones called table_lookup_JZ.
  21. Aha, yes pleaase :)

    Aha, yes pleaase :)
  22. Thanks paul, very helpful as always. I'm using...

    Thanks paul, very helpful as always.

    I'm using usbMIDI.send_now(). Ok so if I send three notes every time and I use send now it should always send them in the same package right?

    The timing may...
  23. Teensy 4 send multiple MIDI notes at once through USB.

    Hello!

    I'm wondering if it's possible to send multiple MIDI notes at once through USB midi.

    As far as I understand MIDI works sequencially sending one message at a time but I'm wondering if...
  24. Since we are discussing map functions: is there a...

    Since we are discussing map functions: is there a way to map a variable non linearly? For instance if a variable goes from 0-1023 make it 0-1023 but a logarithmic response.
  25. Ah, yes that is cleaner than what I did, thanks 😊

    Ah, yes that is cleaner than what I did, thanks 😊
  26. Also I had to limit the output to between 0 and...

    Also I had to limit the output to between 0 and 44. The map function went over and under the range.
  27. Yes I used your method but with floats and added...

    Yes I used your method but with floats and added 0.5 before converting to int. This works as it should. It rounds it to the correct value.
  28. Here is the solution, this produces accurate...

    Here is the solution, this produces accurate results:



    void setup()
    {



    }
  29. Both the suggestions produced the same result. It...

    Both the suggestions produced the same result. It discards the value. However clearly this is the way to go. I can use floats in stead and then make a function that rounds the result to the closest...
  30. Was not expecting replies this fast. Hmm......

    Was not expecting replies this fast.

    Hmm... that may work. I will try. Thanks.
    Will have to see how fast it is, I don't know what's inside the map function.



    Thanks for the suggestion. This...
  31. Function to find index in 2D array based on sensor values

    Hello!

    I need to write a program that can find the right indexes in a 2D array based off of sensor values and have no clue how to best solve this in an effecient way.

    Basically I have two...
  32. Thanks for the examples. Well right now I'm...

    Thanks for the examples.

    Well right now I'm only using the data to see what's happening and that my code is doing what it should. I'm only 30% done with the program. Later when the program is...
  33. Basically what I need to send is comma separated...

    Basically what I need to send is comma separated int and float values. Maybe I could just send it as a string, not sure if the program will accept it.
  34. Aha I understand. So the program stops execution...

    Aha I understand. So the program stops execution until there is room in the queue?

    It is strange because I'm getting delays of about 8-14 micros to write 15 lines. If that was the case then the...
  35. Ok, so I'm back with more stupid questions about...

    Ok, so I'm back with more stupid questions about speed.

    I have working code done in defragsters suggested way. I have 8 sensors connected with code executing between each sensor pair. It seems...
  36. Thanks 🙏 Just needed to be sure

    Thanks 🙏 Just needed to be sure
  37. Thanks, the pins are valid on the teensy 4 which...

    Thanks, the pins are valid on the teensy 4 which Iím using and he did specify that.

    Iím getting some strange values ocassionally and itís because of my code but wanted to make sure it wasnít...
  38. Hello! I'm trying to do calculations while...

    Hello!

    I'm trying to do calculations while waiting for conversions to finish.
    Is it guaranteed that ADC0 will read sensor A0 and sensor A2? And
    ADC1 will always read A1 and A3 in this code? If...
  39. Thanks, I think this is very clear now. So if...

    Thanks, I think this is very clear now.

    So if we have 4 bits and want to convert an unsigned value of 1111 which is 15 to a signed 4 bit value, then that would convert into -7. However as long as...
  40. That is true, maybe not that great for the forum....

    That is true, maybe not that great for the forum.

    I don't seem to have problems but maybe it only shows in a certain situation that I'm not anticipating.

    Is there any situation where a 0 will...
  41. In stead of making more noob threads I'll just...

    In stead of making more noob threads I'll just ask here:

    I've run into a little trouble with unsigned integers. As I understand you can't mix unsigned and signed together.

    For example: If I...
  42. That is very convenient indeed, I haven't read...

    That is very convenient indeed, I haven't read about classes yet. I've mostly read about C so far because it was a bit simpler to learn but i will get there eventually because I've noticed they are...
  43. Ah, much appreciated. Thanks :)

    Ah, much appreciated. Thanks :)
  44. How would I actually read it? uint32_t...

    How would I actually read it?



    uint32_t g_cycleCounter = ARM_DWT_CYCCNT;

    void setup() {
    }
    void loop(){
    uint32_ t start = g_cycleCounter;
  45. I will check. I usually use elapsed micros to...

    I will check. I usually use elapsed micros to check these things. I assumed it was pretty instantaneous until you said it above.

    I didn't get around to using the cycle counter. I will check the...
  46. That's great. How much CPU time are we talking? ...

    That's great. How much CPU time are we talking?

    I would only need to set a timer to 0 when a rising value passes zero and then check the elapsed time when it goes back down below zero. So the...
  47. How many elapsedMicros can you use on the teensy 4?

    I'm new at programming, I'm still half way through a book on C programming and I'm learning so bare with me.

    Is there a limit on how many timers you can run simultaneously with the teensy 4?
    ...
  48. Yeah as I said I used the fastest settings for...

    Yeah as I said I used the fastest settings for conversion and sampling. I can use medium and see if it goes away. My guess is that the capacitor inside the A/D doesnít discharge in time for some...
  49. Well itís an AC signal, the first peak is a...

    Well itís an AC signal, the first peak is a negative half wave sinusoidal signal that lasts up to 2ms but it vibrates up/down for maybe 50milliseconds after the first peak before calming down...
  50. Thanks 😊 🙏

    Thanks 😊 🙏
Results 1 to 50 of 144
Page 1 of 3 1 2 3