Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Chip runs a mostly unmodified Arduino program (video) - Page 4 — Parallax Forums

Propeller Chip runs a mostly unmodified Arduino program (video)

124»

Comments

  • TinkersALotTinkersALot Posts: 535
    edited 2013-07-21 11:15
    Martin_H wrote: »
    Here's a new version of my libPropelleruino being used with the Arduino knob sample. To do that I'm using Martin Hodge's Propeller ASC coupled with TinkersALot ADC code and my Servo library. I took TinkersALot's code and Arduino-fied it to use pinMode, digitalRead, digitalWrite, and delayMicroseconds. In the process I introduced a rather insidious bug that broke his code. It turns out his delay function has a floor of 400 microseconds, while my Arduino version does not. But when I added that floor I broke my Servo library.

    I'm embarrassed to say it took me all morning to figure out the conflict because the symptom wasn't obvious. Everything sort of worked but for certain values pulseOut (which uses delayMicroseconds) would freeze and lock the cog. Anyway here's the new code:

    Nice work! Integrating code can be frought with hazard, but all is well that ends well. That 400 us floor is likely not needed, and could be cruft left over from my getting the adc code to work. So, it is likely very much better that is removed. What do you think of cogifying some of these features? That seems to be a natural next evolutionary step.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-07-29 20:06
    @Whit, thanks. @Tor, thanks I'll keep that in mind for the future.

    @TinkersALot, the servo tending code already runs in a cog, but certainly moving other functions to cogs is something to keep in mind. What I may do is group a bunch of functions into a single cog as things progress.

    @All, attached it the latest version of library with the Arduino stepper motor sample. I also added support for a simple Serial.println which is used in many sketches.

    StepperOneRev.zip

    It ported over pretty easily except I still don't have support for the millis function, so I changed it to use delay instead.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-10-27 18:32
    Hi, I finally bit the bullet and learned how to use code.google.com and GIT. So I've uploaded the libPropelleruino code and unit tests to the following repository:

    https://code.google.com/p/lib-propelleruino/

    If anyone is interested in using this library let me know what sort of documentation you'll need. If you want to add code for an uncovered Arduino function I'm more than willing to add contributors. Issue reports are also welcome.
  • cavelambcavelamb Posts: 720
    edited 2013-10-28 10:54
    Well done, Martin!
  • jazzedjazzed Posts: 11,803
    edited 2013-10-28 11:13
    That's great Martin.

    This is a very valuable library for helping Arduino users who are intrigued by Propeller get involved.

    I'll look into some packaging options to make using the library a little easier for folks that aren't interested in git or other source control.

    Thanks.
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-10-28 15:18
    Excellent work Martin! I'll have to try it on my RoboProp board.
    Martin_H wrote: »
    Hi, I finally bit the bullet and learned how to use code.google.com and GIT. So I've uploaded the libPropelleruino code and unit tests to the following repository:

    https://code.google.com/p/lib-propelleruino/

    If anyone is interested in using this library let me know what sort of documentation you'll need. If you want to add code for an uncovered Arduino function I'm more than willing to add contributors. Issue reports are also welcome.
  • small_toyssmall_toys Posts: 3
    edited 2013-12-11 18:36
    I have started working on SPIN code for the Radio Shack TFT Touch Screen Shield. I have not tested all functions but am working thru them as I get time, although it did display the color table from the wiki example. Hopefully might have it completed by the weekend. By the way, I am using the ASC+ board.

    I have been looking at the 4 wire touch screen and this will not work on the ASC+ since we can not change the analog input pins to be outputs, digital or analog. So not all Arduino code will be compatible with out some software or hardware changes.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-12-12 02:59
    That's a good point, I imagine that the lots of LED's shield won't work either because I think it needs to do the same.
  • Matt WhiteMatt White Posts: 60
    edited 2017-05-04 02:49
    I realize this is an old thread. Looking for how to use libArduino/libPropelleruino in Simple IDE and not finding much documentation. I've read the docs on adding libraries, also tried to put all the files into a single project folder, not having much luck with it. Mostly seems due to pathing issues- complaints about not being to find the header files or the linker not being able to find the library components. Has anyone successfully gotten this to work? If so, how did you do it?

    thanks in advance ..
  • Hi Matt, I wrote the library a few years back and it does work. What I do is compile the library and then create a project under the tests directory. You need to modify the project so the include and lib paths can pull in the library. You should see something like this in the project file:

    -I ../../libPropelleruino
    -L ../../libPropelleruino

    A modification is required to your source which is to add a "#include <Arduino.h>" at the top of the main file. This is because the SimpleIDE doesn't automatically include it like the Arduino IDE.
  • That did it, thanks Martin!
Sign In or Register to comment.