Shop OBEX P1 Docs P2 Docs Learn Events
New to Propeller programing — Parallax Forums

New to Propeller programing

djtdjt Posts: 19
edited 2009-11-13 21:17 in Propeller 1
I am a propeller programing neophyte, therefore please accept my questions in that light. I am attempting to run Full Duplex Serial Plus V1.3·obtained from Object Exchange, and display the results on Parallax Serial Terminal. The program complies and·I can open a Parallax Serial screen. No data is presented.
I have run the Education Kit programs on my board and returned results from the Parallax Serial screen. So, the board setup appears to be OK.
I have entered specific data (31,30,0,57600) for the rxpin,txpin, mode, and baudrate with no success. Get an error message -- expected unique parameter name.
Had similar problems with Sensirion Demo(also from Object Exchange). Tried substituting Parallax Serial Terminal and Mirror.spin for the TV object. No data returned on the Parallax Serial Terminal screen.
What am I missing and where have I gone wrong ?

Thank's,· DJT·····

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-10 15:25
    It's impossible to tell without more information.

    Use the Attachment Manager (click on "Post Reply" to get it) to attach an archive of your program to a reply. The Propeller Tool will make an archive for you ... See the "Archive Project" menu item in the Files menu.
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-11-10 16:52
    Hello djt,

    welcome to the forum !

    The forum-members (and especially me) likes to have the COMPLETE SPIN-code.
    Complete means YOUR code from the very first to the very last line AND ALL object-files.

    As Mike has described above there is a quick way to do that. You simply archive the files to a ZIP-file
    from INSIDE the propellertool and attach this zipfile to a posting.
    Then anyone who wants CAN download the attachment and CAN
    have a close look at the code. As ONLY then everything is included the others can compile your code.
    If objects are missing they can't compile it (or have to search around for the missing objects)

    See the attched picture how to save ALL files to a zip-archive. It's even less work than all other ways
    like copy&paste or whatever.

    best regards

    Stefan
  • SRLMSRLM Posts: 5,045
    edited 2009-11-10 19:31
    Did you bother to click on the image link Stefan posted above? Look at it, it explains everything!
  • rjo_rjo_ Posts: 1,825
    edited 2009-11-10 19:54
    The error message probably means that you are creating two variables with the same name... possibly one in the Con section and one in the VAR section... or one as a local variable in the first line of a method.
    The nice thing about the Prop is that when things don't work... it is usually your fault[noparse]:)[/noparse]
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-11-10 21:31
    Hello djt,

    the code you posted does compile with no error-message. So where is the problem ?

    458 lines of code is 440 lines too much for posting it directly into a message
    If you want the forum to READ your postings keep the text short
    (range 10-30 lines of 80 columms)

    please click on the small picture below

    best regards

    Stefan
  • djtdjt Posts: 19
    edited 2009-11-10 23:18
    My apologies
    to the Forum. I haven't learned how to get the file from Propeller Tools without copying and pasting. I'll work on it.
    Thank's for your comments and I'll be back after·I've had a chance to look at it again.·
  • djtdjt Posts: 19
    edited 2009-11-11 02:36
    I think I have learned how to use the image.
    Once you have successfully compiled the program, as you did and as I did, what prevents me from obtaining data from the Parallax Serial Terminal screen, because no data shows up. Are you saying·the program is running properly and somehow I have to input·additional data into the program to have it show up on the screen?
    Thank's for your input.·djt
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-11-11 06:43
    Hello djt,

    OK now I can see what is going on

    Yes you are right need additional things.

    But NOT inside the file FullDuplexSerialPlus.spin
    You should leave this file as it is

    If you just loaded the file FullDuplexSerialPlus.spin
    compiled this file to RAM or to EEPROM it is normal that nothing happens

    FullDuplexSerialPlus.spin ist just some kind of a "driver" that provides functionality
    you have to use in an OTHER *.spin-file

    You have to use the file FullDuplexSerialPlus.spin as an "object" which is used
    by a file that you write on your own.

    The file FullDuplexSerialPlus.spin should ONLY contain its predefined code and NOTHING ELSE

    I attach a demo-program to my posting that shows you how to use this file

    best regards

    Stefan
  • djtdjt Posts: 19
    edited 2009-11-11 14:34
    Thank's for the info. I'm sure I'll have additional questions.I'll return when I've had a chance to digest the software.

    djt
  • djtdjt Posts: 19
    edited 2009-11-12 03:13
    What does "float to format" mean. This is used in the SensirionDemo.spin program. See attachment.
    When compiling the program I get an error message--subroutine expected at the float to format line.

    Thank's·· djt
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-11-12 04:32
    Hi DJT,

    I'm a newbie too. So here goes, a crash course trying to condense 200 pages of the propeller manual into a few paragraphs.

    subroutine expected is because it is missing. At the top of the program is
    ''   ───SensirionDemo
    ''        ├──Sensirion
    ''        ├──vga_text
    ''        ├──FloatString
    ''        └──Float32
    
    



    You need all 4 spin files in whatever directory you are working from.

    What is "fp"? Well, further down the program, all the above spin programs are renamed:
    OBJ
    
      term          : "vga_text"
      'term          : "tv_text"
      sht           : "Sensirion"
      fp            : "FloatString"
      f             : "Float32"
    
    



    Then you use them with lines of code like this
    fp.FloatToFormat(fahrenheit(tempC))

    Why name it then rename it? Well, if you have an object that prints to a TV screen, and you want to change all output in the entire program to now output to a VGA screen, you can drop in a new object (eg a VGA driver instead of a TV driver) and rename it just once in the OBJ section.

    Objects sometimes come packaged with a demo program, but they may not. Eg the fullduplexserial object earlier may not have a demo. StefanL38 has posted a nice demo as a single package.

    I don't know if you have programmed other languages like Basic or C, but objects are like keywords in those languages. eg PRINT in Basic or PRINTF() in C. The serial object is like the code behind the PRINT statement. It doesn't do anything until you use it, eg PRINT "Hello World". In Spin this might be

    OBJ
    PRINT : "fullduplexserial"

    and further down in the code
    PRINT.tx("Hello World") ' where tx is pre-defined in the fullduplexserial object (which we renamed PRINT in the OBJ section.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/build
  • djtdjt Posts: 19
    edited 2009-11-12 14:34
    Thank you for your comments. They are very helpful, however I remain confused. I placed all four spin files in the directory I am using for SensirionDemo.·This includes the fp alias FloatString object.·Shouldn't the FloatToFormat method be in the FloatString file as a method. If it is I can't locate it. As an alternate,
    should I name FloatToFormat as a method in SensirionDemo, if so what should·it do?

    I have not modified the SensirionDemo file,· or the required spin files, so it should include everything needed to compile and run.··I don't recognize what I have missed.


    Thank's again for your help. Your additional comments would be appreciated······ djt···
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-11-12 19:15
    Hello djt,

    I think I found the bug

    @parallax pay attention

    the setup-file of the propellertool contains a real old version of floatstring.spin

    the header inside this file is this

    ''***************************************
    ''*  Floating-Point <-> Strings         *
    ''*  Single-precision IEEE-754          *
    ''*  Author: Chip Gracey                *
    ''*  Copyright (c) 2006 Parallax, Inc.  *
    ''*  See end of file for terms of use.  *
    ''***************************************
    
    



    now the actual version of floatstring.spin contains THIS header

    ''*****************************************
    ''* Floating-Point <-> Strings v 1.2      *
    ''* Single-precision IEEE-754             *
    ''* Authors: Chip Gracey and Cam Thompson *
    ''* (C) 2006 Parallax, Inc.               *
    ''* See end of file for terms of use.     *       
    ''*****************************************
    
    '' v1.0 - 01 May 2006 - original version
    '' v1.1 - 12 Jul 2006 - added FloatToFormat routine
    '' v1.2 - 06 Mar 2009 - added StringToFloat [noparse][[/noparse]mpark]
    
    



    the sensirion-demo uses the v1.1 or v1.2 with the added FloatToFormat-method which is missing in the floatstring.spin which is stored
    in the subdir C:\Program Files\Parallax Inc\Propeller Tool v1.2.6

    so download the newest version of the FloatString-object

    it's bad that this NEW object uploaded by Michael Park has the EXACT same name as the old object
    if you do a search in the obex for floatstring you can see
    the different versions containing different methods with the exact same name

    best regards

    Stefan

    Post Edited (StefanL38) : 11/12/2009 7:23:22 PM GMT
  • mparkmpark Posts: 1,305
    edited 2009-11-12 22:05
    Oops. That was my first contribution to the obex and I wasn't clear on how to handle versioning. Sorry I messed up!

    For future reference, what should I have done?
  • MacGeek117MacGeek117 Posts: 747
    edited 2009-11-12 22:24
    @djt: Other forum members have said this, but it bears repeating: Please read the Propeller Manual! It will answer a lot of your questions. The manual is accessible through Help>> Propeller Manual
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    BS2: $49


    SX48 Protoboard: $10

    Propeller Protoboard: Priceless

    www.apple.com

    www.parallax.com

    www.goldmine-elec.com

    www.expresspcb.com

    www.jameco.com
  • djtdjt Posts: 19
    edited 2009-11-13 15:45
    Thank you. The program is compiling and running. My goal is a unit to obtain, display and record temp, RH, and light readings in my greenhouse over a 24hr period. Next step is light. Your assistance has been appreciated.

    djt
  • MacGeek117MacGeek117 Posts: 747
    edited 2009-11-13 21:17
    For light, try the TSL230 Light-frequency converter. there's a couple of obj's in the OBEX. Paul Baker's is REALLY easy to use.
    Temp and RH would be easy with the SHT11.
    RoboGeek


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    BS2: $49


    SX48 Protoboard: $10

    Propeller Protoboard: Priceless

    www.apple.com

    www.parallax.com

    www.goldmine-elec.com

    www.expresspcb.com

    www.jameco.com
Sign In or Register to comment.