Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible to add a few demos that support Parallax sensors? — Parallax Forums

Is it possible to add a few demos that support Parallax sensors?

Capt. QuirkCapt. Quirk Posts: 872
edited 2012-06-20 07:18 in Propeller 1
I would find it helpful if there were a few programs that both resemble popular OBEX
programs with a simplified C programming style. I have found it difficult to make the
transition to writing a C program using the current demos.

Two programs that I believe would be good examples for understanding bit behavior and
the C Library are: (1) Beau Schwabe's Memsic 2125 Accelerometer DEMO - Serial
Version and (2) Jon McPhalen's jm_lcd4_ez

Bill M.

Comments

  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-06-19 18:38
    I'm trying to learn C but as a rabid fan of Spin/PASM, it's not coming easily. What I am doing is working through all of my objects that use PASM to ensure that the interface to the PASM cog is only through PAR so the code can be used by GCC, too. I think the thing that gets under my skin the deepest is that I have to create two files for every library (.h and .c). I'll get there....
  • jazzedjazzed Posts: 11,803
    edited 2012-06-19 20:30
    JonnyMac wrote: »
    I think the thing that gets under my skin the deepest is that I have to create two files for every library (.h and .c). I'll get there....

    Jon, It's a methodology.

    The primary reason to use a .c and a .h file in C is to allow for library code sharing and compile time type checking of function signatures. You can do things differently if you never intend to share the .c code as a compiled library.

    C++ is much closer to Spin than straight C. You can include all your code in a C++ class if you like and use it similar to Spin. Some folks may look at you funny for doing so, but you may enjoy it more in the short term.
  • sevssevs Posts: 50
    edited 2012-06-20 07:18
    I would find it helpful if there were a few programs that both resemble popular OBEX
    programs with a simplified C programming style. I have found it difficult to make the
    transition to writing a C program using the current demos.

    I feel like i am in the same boat Bill. It feels like you go from a toggle demo to a vga demo. I imagine a lot of this has to do with my no C experience and not the greatest spin/PASM abilities. Unfortunately writing demos and tutorials takes time and resources :(

    I am trying to get JM's One wire device code working. As far as i can see i have copied the relevant parts from the toggle demo but still no luck. But persistence will pay off i hope :D It is much easier now with this beta build for me to test changes though, thanks again Steve and all involved!
Sign In or Register to comment.