Shop OBEX P1 Docs P2 Docs Learn Events
Port Charmed Labs Zumo Line Following demo Arduino C code to the Propeller 1 — Parallax Forums

Port Charmed Labs Zumo Line Following demo Arduino C code to the Propeller 1

Hi All,

One of the problems that I have encountered attempting to port the Charmed Labs Zumo Line Following demo Arduino C code to be used by the Propeller Activity Board on my Arlo imitation ActivityBot is that the SimpleIDE compiler seems to be unable to compile header .h files that don't have an accompany .c file.

The following Charmed Labs Arduino .h files have the C code embedded with each header in the .h file and the Arduino IDE complies these .h files without error:
Pixy2.h
TPixy2.h
Pixy2CCC.h
Pixy2Line.h
PIDLoop.h

However, the SimpleIDE compiler chokes on these .h header files. So my approach has been to modify the line_zumo_demo.ino code to transmit left and right motor speed commands to the Arlo-ActivityBot over a serial link and use drive_speed(left, right) to let the Pixycam2 control Arlo-ActivityBot to follow a line.

Comments?

Regards,
TCIII

Comments

  • RaymanRayman Posts: 14,646

    Can you just #include the header files somewhere?

  • TCIIITCIII Posts: 81
    edited 2022-06-25 14:51

    Post deleted.

  • RaymanRayman Posts: 14,646

    Sorry, I meant to suggest using the #include directive on these files, perhaps in the main c file.

  • Do you even know if you need to have those .h files in the compilation? Usually .h files contain only declarations, not code, and will already be included by the appropriate .c or .cpp files.

  • @Rayman,

    Unfortunately, no.

    Regards,
    TCIII

  • RaymanRayman Posts: 14,646

    I’ve ported a few Arduino programs to P2 using flexprop flexC .

    Should work for P1 too. Might try that…

  • @ersmith said:
    Do you even know if you need to have those .h files in the compilation? Usually .h files contain only declarations, not code, and will already be included by the appropriate .c or .cpp files.

    @ersmith,

    The Charmed Labs header files listed above really do contain .c code. Unfortunately the .c code in those header files are not included in the main Arduino .ino code.

    Regards,
    TCIII

  • @Rayman said:
    I’ve ported a few Arduino programs to P2 using flexprop flexC .

    Should work for P1 too. Might try that…

    @Rayman,

    Thanks for the response, I will give it a try.

    Regards,
    TCIII

  • RaymanRayman Posts: 14,646

    Btw: I’m told that Arduino will automatically compile all files in the .ino folder. But, flexprop and probably simpleide don’t do that. You need to add these files to the build command line I think.

  • @Rayman said:
    Btw: I’m told that Arduino will automatically compile all files in the .ino folder. But, flexprop and probably simpleide don’t do that. You need to add these files to the build command line I think.

    @Rayman,

    Thanks for the info, much appreciated.

    I will give it a try.

    Regards,
    TCIII

Sign In or Register to comment.