Share My Creation Oscilloscope

Discussion in 'Share Your Creations' started by klaus, Jan 5, 2012.

  1. klaus

    klaus Expert Licensed User

    After a question here 'How to create a scope', I played a bit with the subject. Reminded me some 'old' days :).
    The program can:
    - display 4 curves, selectable
    - select time interval (sampling rate)
    - select the scale for each curve
    - set an offset for each curve
    - three diplay modes (SCOPE, MEM, ROLL)
    - when the scope is stopped, display the curve values (touching the screen and moving)

    The program is based on a timer, therefore there could be timing problems on slow devices.
    The scope is on a panel so it could be used in other programs.
    The curves are calculated, but it's possible to change the GetValues routine to get other signals.

    The program is more a 'demonstrator' rather than a stand alone scope.
    Bug reports and suggestions are welcome.

    Best regards.

    EDIT: 2012.01.07 Version 1.1
    Amended bug reported in post #9

    EDIT: 2012.01.10 Version 1.2
    ROLL mode does work, but somewhat slow

    EDIT: 2012.01.11 Version 1.3
    Amended the bugs reported in post #14

    EDiT: 2018.05.04 Version 1.4
    Set the target version to 26 in the ManifestEditor
    <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
     

    Attached Files:

    Last edited: May 4, 2018
  2. vb1992

    vb1992 Well-Known Member Licensed User

    Cool Stuff Klaus !
     
  3. thedesolatesoul

    thedesolatesoul Expert Licensed User

    wow...that looks so cool!
     
  4. vb1992

    vb1992 Well-Known Member Licensed User

    been having fun with the example code
     
    Last edited: Jan 6, 2012
  5. Tom Christman

    Tom Christman Active Member Licensed User

    :sign0142:Beautiful work (as usual) Klaus!
     
  6. Scantech

    Scantech Well-Known Member Licensed User

    Klaus!!! You just made my day! This is awesome and many thanks.
     
  7. ta1dr

    ta1dr Member Licensed User

    :sign0098: thanks Klaus
     
  8. pinoy_ako

    pinoy_ako Member Licensed User

    nice share Mr. Klaus. thanks. now i'm thinking of hooking my ioio to this. i just can't think i can. :D
     
  9. Scantech

    Scantech Well-Known Member Licensed User

    Is the "U/Div" something like a Zoom function? Smaller "U/DIv" values appears to make the drawing bigger.

    Setting the "U Offset" below 0 and decreasing the value of the "u/div" will cause graphing lines to go upward direction with higher GetValues. But setting the offset above 0 will cause the graphing lines to go downward direction from the main offset starting point when decreasing the value of u/div. Is this the intention of the program or a bug?

    Setting 0 offset is at the center of the grid which is normal, but setting Negative U/Offset will start above the 0 grid area and positive U/Offset value will start below the 0 offset area. Bug?

    I am really starting to like this app. Rolling function will be great. I wish I can help but I need more time studying the codes.

    I was testing it with this code.

    Code:
    Sub GetValues
       
    Dim i As Int
       
       
    For i = 0 To CurvesNb
          
    'CurveVal(i, ii) = a(i) * Sin(w(i) * t)
          CurveVal(i,ii) =  Rnd(0,2)
       
    Next
    End Sub
     
  10. klaus

    klaus Expert Licensed User

    This is a normal function of an oscilloscope.
    If you have an amplitude of 1 unit (volt or anything else) and a scale of 1 unit/division (1 U/Div) the amplitute on the screen is 1 division.
    If you still have an amplitude of 1 unit and a scale of 0.5 unit/division (0.5 U/Div) the amplitute on the screen is 2 divisions ( 1 / 0.5 = 2).
    If you still have an amplitude of 1 unit and a scale of 2 units/division (2 U/Div) the amplitute on the screen is 0.5 division ( 1 / 2 = 0.5).

    This is a bug.

    The offset setting is in curve units, and not divisions.

    Updated version 1.1 in the first post.

    Best regards.
     
  11. Scantech

    Scantech Well-Known Member Licensed User

    Klaus, See attachment. Roll function works but I get the feeling it's not done right. Maybe you can polish it up. r1 and r2 got me confused.

    There is a bug on #3 offset. the Event name is not correct.
     

    Attached Files:

  12. klaus

    klaus Expert Licensed User

    Version 1.2 available in the first post with the ROLL mode working, but somewhat slow.
    @Scantech
    I tried your version, but it's not the right method.
    Anyway the solution with copying bitmaps was not the right way to do it because the number of pixels for one step is not an integer.

    Best regards.
     
  13. Scantech

    Scantech Well-Known Member Licensed User

    Well Done Klaus. I like it and works really good on my slow device. Lot better then copying bitmap.
     
  14. Scantech

    Scantech Well-Known Member Licensed User

    This attachment fixes a bug when switching Modes.

    For/Next statement in the Roll can lead to a problem. I never figured out a way how to get out of this loop when exiting app on Android. It will keep looping and App will not reload. Other than that, everything else is smooth.
     

    Attached Files:

  15. klaus

    klaus Expert Licensed User

    The amended update version 1.3 is in the first post.

    Best regards.
     
  16. vb1992

    vb1992 Well-Known Member Licensed User

  17. alan1968

    alan1968 Active Member Licensed User

    Hello Klaus,

    I give you permission to use your code because I also tilt module in my app but less successful than yours

    Alan
     
  18. klaus

    klaus Expert Licensed User

    Yes, you can use the code without any restriction and modify at your conveniance.
    Tu peux utiliser le code sans aucune restriction et le modifier selon tes besoins.

    Best regards.
     
  19. alan1968

    alan1968 Active Member Licensed User

    merci ,c'est super sympa ! :icon_clap:
     
  20. rajeev.piyare

    rajeev.piyare New Member Licensed User

    Dear Klaus
    Could you please advice as how can we use this for getting data from Arduino via a Bluetooth. I would like to plot real-time graphs for sensor inputs connected to Arduino analog input pins.

    please help.

    thanks in advanced.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice