Shop OBEX P1 Docs P2 Docs Learn Events
beginner trouble- LSM9DS1 — Parallax Forums

beginner trouble- LSM9DS1

I'm new to everything here. However, I'm really having trouble with sensors.

That's not quite true, I can blink an LED, and I successfully used the INA219 current sensor. However, I can't get the LSM9DS1 9dof IMU to work.

I'm using the demo code from avsa242's p2 spin standard library: https://github.com/avsa242/p2-spin-standard-library

I'm running into multiple problems trying to use LSM9DS1 via I2C.

1) I can't compile anything with Propeller Tool. I consistently get the error 'Expected "," or end of line'.
1a) I can't figure out how to add a library path to propeller tool--am I just missing it?

2) I can compile and upload using FlexProp, but all I get via serial is 'LSM9DS1 driver failed to start - halting' and I can't figure out what's going wrong.

Help?

Comments

  • JonnyMacJonnyMac Posts: 9,158
    edited 2023-06-01 03:49

    If you have a newer installation of Propeller Tool, you'll find the library in you Documents folder under your user name. In my case it's here:
    -- C:\Users\jmcph\Documents\Propeller Tool\Library

    Put your libraries in that folder and try again. Propeller Tool uses a fixed library location. Flex Prop allows you to add custom paths, so you can add your Propeller Tool library path to it. Also consider Spin Tools by @macca. It has the look and feel of Propeller Tool -- but it's better (and x-platform). And as Parallax has pulled the plug on Propeller Tool (which it really hasn't improved since it was created), Spin Tools may be a better option. Macca has been very responsive to user reports of issues and feature requests. Spin Tools also allows the addition of library paths, so I point to my Propeller Tool library.

  • JonnyMacJonnyMac Posts: 9,158
    edited 2023-06-01 03:54

    Never mind -- that code was written to work in Flex Prop only; Propeller Tool does not support conditional compilation directives. I'm not sure if those directives work in Spin Tools.

  • Hi @jaspast
    As Jon noted above, I wrote that driver (and others) designed for FlexSpin (FYI I do note this in the readme that comes with each repository). The Propeller Tool only fully works on Windows and I just find it too limiting. FlexSpin is available on virtually any platform.

    If you try the demo under FlexSpin and it reports the driver fails to start, double check your connections first and make sure the I/O pin assignments in the demo match. Also if you're connecting it via I2C make sure you've pulled both of the CS lines on the LSM9DS1 high. If it still doesn't start, let me know and we can try to figure out why.

    Cheers,
    Jesse

  • RaymanRayman Posts: 14,744

    You can try this, was 3 years old and needed some changes to compile.
    It compiles with Prop Tool, but not sure if it still works...

  • Thank you all. I got it to work. I had so many problems...

    I also had to change ADDR_BITS to 1 (rather than 0).

    @JonnyMac
    Thanks for the info about Propeller Tool and Spin Tools. Parallax still lists Propeller Tool as the IDE (https://www.parallax.com/propeller-2/programming-tools/). If Propeller Tool is stagnating, how am I (a propeller newcomer) supposed to know things like that?

  • evanhevanh Posts: 16,027

    That's news to me too. Not that I use Prop Tool myself. I now wonder if there has been any announcements.

  • JonnyMacJonnyMac Posts: 9,158
    edited 2023-06-02 14:00

    Parallax still lists Propeller Tool as the IDE

    It's not going away, it's just not going to change.

    I now wonder if there has been any announcements.

    There was -- sort of -- via live steam. Ken and I spoke a few days before this stream and he told me of their intentions. It's at the 36:50 mark -- it's even annotated in the video notes on YouTube.

    Chip will continue to develop PNut so there is an official compiler from Parallax, but it won't be integrated into Propeller Tool any more. In the video, Chip talks about using TypeScript to rewrite the compiler. Macca already has a compiler in Java -- it would be interesting if Chip adopted that so that there was a canonical Parallax compiler suitable for x-platform use (something many of us have asked Parallax for years).

    Sorry for the thread distraction; it was not my intent.

Sign In or Register to comment.