Shop OBEX P1 Docs P2 Docs Learn Events
ColorPAL and SimpleIDE code (Propeller C) — Parallax Forums

ColorPAL and SimpleIDE code (Propeller C)

NikosGNikosG Posts: 705
edited 2015-04-10 06:34 in Accessories
Does anyone have code in Propeller C able to run with SimleIDE for the ColorPAL sensor?

Tutorials with Propeller C - Simple Devices have a lot of examples for many sensors, but no one example for the use of the ColorPAL .

Of course there is a very good examlpe of code in SPIN language by Phil Pilgrim but nothing with Propeller C.

Comments

  • dgatelydgately Posts: 1,630
    edited 2015-04-07 20:21
    Nikos...

    Spin2cpp provided a C code version of Phil's project quite easily. I copied the files into SimpleIDE and built a new C project that compiles. PASM portions of the code were translated to inline GAS code in two of the .c files. I don't have a ColorPal, so I can't test this, but it "should" provide a good starting point for your own project.


    PhiPi's ColorPal_sense in C:
    ColorPAL_sense.zip


    dgately
  • NikosGNikosG Posts: 705
    edited 2015-04-10 06:34
    dgately,

    Thank you!!!!!

    It works!!!
    The C code has the same result as the Spin code.
    It returns (in the screen) the 3 parameters of red, green and blue color, that gets the sensor

    Now I'm trying to change the code you attached in order to make the sensor to recognize the color of an object ! You wiil have a feedback very soon I hope......


    I had no idea about "Spin2cpp" ! it is a really cool software application!!!!
Sign In or Register to comment.