Storing Information into EEPROM!

drieschnoronha

New Member
Hi guys!

I have just finished my year 11 project for an electronic dice.
The dice counts from 1 to 49 (with 2 seven segments) and when a push to make is pressed, it is detected and hence it stops at the number it is counting at and repeats the segment of code until the PTM is released.

This is a short demo of what i have done.
I have used a 18X to do the counting and used a CC 7 Segment and a CA 7 Segment. This means that neither of the 7 segments will ever be on at the same time but when one is on, the other is off. but if they are made to turn on and off very quickly, it seems that they are on simultaneously.

The (-) represent the display of CC 7 Segment and the (+) represents the CA 7 Segment.

Demo of program written.

If ptm is on repeat next two lines until released; if not carry on to next lines
-1
+1

so now the ptm is on so -1 and +1 are repeated so that each 7 segment shows its own number but they repeat so fast that it seems that both segments are showing 1 at the same time. Hence number 11.

This takes a lot of time to do because it needs to be done for each number 1 to 49 and I used the let pins command. But since the project was due I had to do so. Thanks to God it worked and I got full marks on the coursework. Now I am in summer holidays and wanted to perfect the design and make the program smaller. For this I wanted to know how I could store the let pins commands for the numbers in EEPROM and call on them randomly.

For Example, since the CC 7 Segment is tens place, it would have the numbers 0 to 4 and the CA 7 Segment would have the numbers 0 to 9 for the units place.

Say:
EEPROM1=-0
EEPROM2=-1
EEPROM3=-2
EEPROM4=-3
EEPROM5=-4

EEPROM6=+0
EEPROM7=+1
EEPROM8=+2
EEPROM9=+3
EEPROM10=+4
EEPROM11=+5
EEPROM12=+6
EEPROM13=+7
EEPROM14=+8
EEPROM15=+9

Then I could call on a random number from EEPROM 1 to 5 to display on the CC 7 Segment and then call on a random number from EEPROM 5 to 15 to display on the CA 7 Segment then it would display these two numbers one after the other really quickly and look like these numbers are displayed simultaneously.

The problem with this is, I do not know how to store the let pins commands in EEPROM and how to call on them randomly and make them display one after the other very quickly for a couple of seconds and then wait for the PTM to be pressed again for a new number to be randomly selected.

I would like to extend this further and not have the number 00 ever displayed and stop numbers to be repeated for example if number 14 has been displayed once before it should not be selected again. I think this has something to do with storing the details in the RAM but I am not sure.

I do not want the code from any of you just help on how to write some parts of the program.

If you would like I can provide you with my previous program.

Thanks a lot.:)
 

drieschnoronha

New Member
????

Sorry guys!:(

I'm new to this, so I did not understand a word of the other two threads.:eek:

Can you break it down a bit for me?:confused:

Thanks.:)
 

BeanieBots

Moderator
I think you need to break this down into more specific questions.

You already know about "let pins = ..".
The manual clearly explains the "READ" function required to get data from EEPROM. Put the two together and you have "let pins = data from EEPROM".
 
Top