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

Thread: arbitrary waveform funny signal squarewave unipolar to bipolar

  1. #1

    arbitrary waveform funny signal squarewave unipolar to bipolar

    Hello designers,

    I had a few question referring to the Sample_And_Hold library/array.

    I would like to create the following unipolar and bipolar signal combined. the program should execute on the push of a button. signalfunny.jpg

    I have an idea how to program it but I am looking for an answer that allows me to use the sample and hold array because I think its faster.

    to control the combined waveforms, I would like to use 10 encoders with a push button to save the values.
    10 encoders:

    unipolar square wave: Amplitude,number of pulses, exponential decree,pulse width, interval between pulses.
    bipolar square wave: Amplitude,number of pulses, exponential decree,pulse width, interval between pulses.
    ,

    or 5 encoders with a structured program that allows me to save values. however the follows questions arise.

    Question1: what is the minimum width of the square wave pulse?, should the sample_and_hold array be used or should a loop be executed to generate the waveform for unipolar and bipolar?
    Question2: how can I create this waveform on a tft screen 3.5 Inch 480x320 TFT LCD Breakout Board?
    Question3: Tutorial on structured program with encoders and save function with double click.

    what is the easiest way to complete this?

    many thanks for taking your time in reading this.

    sincerely yours

    Bastiaan
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	signalfunny.png 
Views:	5 
Size:	13.0 KB 
ID:	14666  

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,153
    I'm afraid I don't quite understand any part of your question.

    Maybe you're asking about features in the audio library? But which ones? (there are dozens of objects, some having many features)

    Regarding the display, the most commonly used one is ILI9341 having 320x240 resolution. If you're looking for an easy path with good performance, I highly recommend staying on that well traveled path.

    If you'd like to use a different display, please give us a link to the display and the library you'll use. There are many on the market. These sorts of details matter!

    Rotary encoders are normally used with the Encoder library.

    https://www.pjrc.com/teensy/td_libs_Encoder.html

    That's about the best I can do... only very general answers to unclear questions lacking specifics.

  3. #3
    Hi Paul,

    Thanks for the fast reply, I would like to a signal that resembles like in the attached jpg.
    I had an enlightenment how to create such a signal on the teensy over the analogWrite out yesterday
    First ill have to create a function with 3 for loops.
    The for loops resemble the number of pulses from positive to negative (bipolar) Or from positive to the offset value 2048 (unipolar)
    Inside these for loops I write to analogWrite(MAX_ampl); add a delaymicros(pulsewidth);
    analogWrite(Offset);
    delaymicros(interval);
    Max_ampl=Max_ampl-Percentage; this part diminshes the max amplitude by a percentage during the number of pulses.

    this is repeated for the other two waveforms with a almost similar for loop ranging from negative to positive.

    ill be using the 3.5 inch try from waveshare.

    Ill think ill skip the encoder and move directly to the touchscreen function, but ill keep you posted, to see what is easier to work with.


    Best

    B

Posting Permissions

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