Shop OBEX P1 Docs P2 Docs Learn Events
Unable to open file Simpletools.h — Parallax Forums

Unable to open file Simpletools.h

jwellsjwells Posts: 4
edited 2015-03-11 13:48 in Learn with BlocklyProp
I'm trying to write some very simple code by I get this error when I try to include this library. It probably has something to do with the path the compiler uses to access the library. Example programs don't seem to have an issue opening it. I've tried reading thru documentation to see what I'm doing wrong. Is there some comprehensive documentation to explain this?

Comments

  • Hal AlbachHal Albach Posts: 747
    edited 2015-03-10 14:40
    In Simpleide click on TOOLS then PROPERTIES. Is the Library Folder path actually pointing to the Simple Library folder?
  • jwellsjwells Posts: 4
    edited 2015-03-11 10:12
    Yes. It's pointed to Simple Libraries in the Learn folder.
  • ValeTValeT Posts: 308
    edited 2015-03-11 10:16
    Interesting.....You can download the newest version of the libraries here: http://learn.parallax.com/activitybot

    Can you get access to the file in the downloaded folder?
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2015-03-11 10:23
    It may be helpful to post a copy of the error that appears when attempting to include simpletools.h in your project.
  • jwellsjwells Posts: 4
    edited 2015-03-11 12:07
    Thanks for the help. I'm sure it's something simple.


    The error

    Project Directory: C:/Users/John/Documents/SimpleIDE/Learn/Examples/PropBOE_Spin_Leds_20120130/

    openspin.exe -I C:/Program Files (x86)/SimpleIDE/bin/../propeller-gcc/spin/ 1 Blink Light.spin
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2014 Parallax Inc. DBA Parallax Semiconductor.
    Version 1.00.71 Compiled on Nov 16 2014 09:27:04
    Compiling...
    1 Blink Light.spin
    1 Blink Light.spin(4:5) : error : Expected "=" "[" "," or end of line
    Line:
    int Main()
    Offending Item: Main
    1 Blink Light.spin:1: error: Unable to open file simpletools.h

    My Code

    #include "simpletools.h"


    int Main()
    {
    repeat
    pin.High(9)

    wait(100)
    pin.Low(9)

    wait(900)
    }
  • Hal AlbachHal Albach Posts: 747
    edited 2015-03-11 12:26
    In my Tools Properties the path to Library Folder is: I:/Users/Admin/My Documents/SimpleIDE/Learn/Simple Libraries/

    in your case it should be: C:/Users/John/Documents/SimpleIDE/Learn/Simple Libraries/

    With Windows Explorer can you follow that path and verify it is correct?
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-03-11 12:52
    You seem to be mixing Spin and C syntax. Which language did you want to use?

    EDIT: If you want to use C try creating a C project, and use this code:
    #include "simpletools.h"
    
    int main()
    {
      while(1)
      {
        high(9);
        pause(100);
        low(9);
        pause(900);
        
      }  
    }
    
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2015-03-11 13:23
    If you're trying to code in C, you can find the proper syntax for C commands in the simpletools library by looking in the "Documentation simpletools Library" HTML file in the library folder. (Should be in C:\...Documents\SimpleIDE\Learn\Simple Libraries\Utility\libsimpletools)

    Be sure you are also using the semicolon after your commands as Dave shows in his code (above).
  • jwellsjwells Posts: 4
    edited 2015-03-11 13:48
    Thanks. That did it. It's been a long time since I used C and didn't really even know about SPIN so I guess I'm getting the samples mixed up. How do I know if the samples are SPIN? I was actually trying to use PWM. I see this controller has that module. There is sample code for it but is there some docs that explain it along with wire diagrams?
Sign In or Register to comment.