Steve Earl www.datageo.co.uk
not at all however it depends on the size of the task ,think of moving bricks with a Toyota corolla if you only need to move a few its fine, to move 10000 would be an ordeal better suited to a tray truck with hydraulic loader.
pbp is a great product but if you want to do a lot with floats, longs , singed math , datetime objects colour gui's etc then other platforms and languages make life a lot easier.
Easy does not increase understanding.
Unfortunately we live in a plug and play world. The Pi was created to address the issue of children not understanding how computers work and introduce them to programming so it is made easy to produce quick results and grab their imagination. What it does not do is teach electronics. But as I have never had one my opinion is not a first hand informed one.
Anyway this thread is about time calculation not Pi and have we just hijacked a thread which is against the rules?
Steve Earl www.datageo.co.uk
do I understand the problem correctly
I'm assuming we have a set time day-h:m:s.xx ie day 0 hour 2 minute 30 sec 28.34 and that we then subsequently read a clock and calculate the elapsed time between now and the set time if and only if the now time is greater than the set time .
is this right ?
Richard No.
longpole001's program counts down to set time then counts up after set time.
Steve Earl www.datageo.co.uk
steve ,
so far this is the only place the comparison is made , the flag is used from that point for the other routines
I am down to he last 5k of code space on 128k chip and a fair way to go , i have sd card / code running so i now have to some how make the menu's , some fonts etc all run from the fat16 card , which will need to be somehow index to the menu data, fonts etc , which i not done before ,
so after this clock bit is done, and some oher issues , this will be the next task and i am sure another thread
but examples if anyone has any where the sd card code can
a. a routine that copies the selected lookup table into the created indexed file on the SD , which is accumulative , and returns the indexed start point + data length , the next free point of file for next entry , value back to the program where the routine was called.
c. after output file has been made by the routine above , it is removed from the compile
d. the code that gets the stored data from the start point + length references , fills the required lookup table, as used
i am not sure if SDFS can have more than 1 open file at a time for reading and writing on the fly,but i can see it may need to for other data file creation
regards
Sheldon
the code can make an indexed output hex file of the selected data of the varable sized lookup tables that need to be placed into that hex file
c data with an indexing system for the hex file to find the data which will be on the sd card
d. method and code to assemble the data back into the required lookup table using the index.
i am sure its been done but i could not find an example so far in pbp
I have done the routine you intend using an SD card for but I used on board EEPROM (18F452).
The data in the EEPROM could be changed within the program using keypad and serial LCD display.
However to place the initial data into the EEPROM I created a program just to do that thereby saving code space. But you are thinking in terms of "code"?
Steve Earl www.datageo.co.uk
After same more thinking on my part I have come to the conclusion that I have not appreciated the scale of what you are doing. I agree lets fix the time issue then start another SD car thread.
Steve Earl www.datageo.co.uk
EL2_Allow is a Var bit , atm , and that code would require it to become VAR byte , i am getting very full on this chip and every byte less in mem is a good move ,
i am thinking since the value i am looking for is either 0 or 1 , can i leave the variable as a BIT , even though values higher than 1 are going to occur ?
Tight for space is a very good reason to make the code more efficient.
Obviously you have a routine that sets the time could you set the EL2_Allow and other "flags" within that code. I am thinking that at present the same comparisons are made multiple times in different places.
I am also led to believe that compound statements are inefficient.
is more efficient thanCode:EL2_Allow = 0 EL2_Allow = EL2_Allow + Event1_OT_Day EL2_Allow + Event1_OT_hour EL2_Allow + Event1_OT_Min ' if all values are 0 , then don't enable the overrun timer EL2_Allow + Event1_OT_sec EL2_Allow + Event1_OT_100th
can you explore this idea by trying both ways. This is food for thought for both of us which is very interesting.Code:EL2_Allow = Event1_OT_Day + _ Event1_OT_hour + _ Event1_OT_Min + _ ' if all values are 0 , then don't enable the overrun timer Event1_OT_sec + _ Event1_OT_100th
Steve Earl www.datageo.co.uk
Bookmarks