+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2013
    Posts
    546

    Default Getting data from user, how to store it properly? (kinda dialog interface)

    Hello.

    I'm building a simple digital controller, which works like this: User enters number of points (steps) to move head to. At each step, user enters desired x/y/z positions and movement speeds. Then the task is done based on user entered data. However, user might choose 1 or say 32 points (steps) to do. How get this data from user, and where to store it? my rough idea is like this



    Code:
    FOR A=0 TO B*5 STEP 5' where B is number of total steps to be done.
    GOSUB ENTRYFORM 'Go to subroutine, where user enters X/Y/Z/Speed data. this routine returns values in variables X, Y, Z, S, where each hold appropriate data like position and speed
    WRITE A, X 'Write data to eeprom
    WRITE A+1,Y
    WRITE A+2,Z
    WRITE A+3,S
    NEXT
    I guess this will work, but is there a way to do it without using eeprom ? and there might be another data too, so not all chips might have enough eeprom available. I think it is possible to do this using ARRAYWRITE, but I did not fully understood how to use it, despite reading the reference manual. For the array variables, it is ok, but since I'm using PIC16F886 device, and array variables there are limited to 48 WORD variable, this might allow me to store only 12 "steps" - almost same limitation as eeprom. So it there a way to have more "steps", say 30-40, each of which holds set of 4 WORD variables?

  • #2
    Join Date
    Sep 2009
    Posts
    776

    Default Re: Getting data from user, how to store it properly? (kinda dialog interface)

    48 word array will hold 48 steps...
    Just create array for x,y,z,s...
    Eg
    Code:
    X VAR WORD[48]
    Y VAR WORD[48]
    Z VAR WORD[48]
    S VAR WORD[48]
    
    FOR steps=0 to NoOfSteps
        x[steps]....
        y[steps].... 
        z[steps]....
        s[steps]....
    NEXT steps

  • #3
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    314

    Default Re: Getting data from user, how to store it properly? (kinda dialog interface)

    My son is building a video game (just the screen software, no hardware). What you are discussing is sounding familiar.

    Not sure what you're building (3-D printer?) but I just saw this on the Microchip site. It is about using XC8, not PBP, but the concept should be portable to Basic:

    http://microchipdeveloper.com/tls210...ing-structures
    Last edited by mpgmike; - 16th May 2019 at 04:46. Reason: Add link
    I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.

  • #4
    Join Date
    May 2013
    Location
    australia
    Posts
    1,730

    Default Re: Getting data from user, how to store it properly? (kinda dialog interface)

    tried to impement a structure some years back in pbp , result is a bit clumsy and possibly not worth the effort
    http://www.picbasic.co.uk/forum/show...ghlight=struct
    This is more entertaining than Free to Air TV

  • #5
    Join Date
    Feb 2013
    Posts
    546

    Default Re: Getting data from user, how to store it properly? (kinda dialog interface)

    Thanks, what I'm trying to build is a programmable movie camera crane, for some cinematic action.

  • #6
    Join Date
    Apr 2011
    Location
    Portland, Oregon
    Posts
    221

    Default Re: Getting data from user, how to store it properly? (kinda dialog interface)

    I'm wondering if it may be beneficial to restrict the project to chips with EEPROM? It seems somewhat tedious to enter all those numbers... and then lose them with a loss of power - intentional or not. I suppose, if things remain simple... But I imagine a complex set-up taking days - any interruption of power would mean starting again.

    I imagine myself using an external EEPROM chip - complex set-ups or repeat shots could be saved, transferred between rigs, or even programmed via PC. Maybe something like Excel to calculate the camera path and then exporting via serial would greatly enhance the capabilities of the crane - while reducing the set-up time.
    Last edited by Amoque; - 17th May 2019 at 18:23. Reason: Spelleng :)

  • #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,199

    Default Re: Getting data from user, how to store it properly? (kinda dialog interface)

    Might I suggest FM24W256 from RamTron. It is an EEPROM with NO write delay and 151 year data retention. I use them on quite a few of my products and have had NO failures at all. They also support 100Khz. and 400Hhz. clock speeds.
    Dave Purola,
    N8NTA
    EN82fn

  • Similar Threads

    1. eeprom how many data can store
      By DragonBall_6 in forum mel PIC BASIC Pro
      Replies: 8
      Last Post: - 5th December 2006, 11:39
    2. Where to store incoming data ?
      By f_lez in forum General
      Replies: 5
      Last Post: - 23rd August 2006, 08:07
    3. Graphical user interface
      By rocky79 in forum mel PIC BASIC Pro
      Replies: 13
      Last Post: - 15th October 2005, 12:25
    4. DATA command not working properly
      By khufumen in forum mel PIC BASIC Pro
      Replies: 5
      Last Post: - 2nd December 2004, 11:54
    5. User Configuration Interface in PBP
      By Radiance in forum mel PIC BASIC Pro
      Replies: 1
      Last Post: - 7th February 2004, 08:00

    Members who have read this thread : 15

    You do not have permission to view the list of names.

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts