Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I am experimenting reading and writing to a pic eeprom using swordfish but my question is?
when you write to the eeprom then turn off the device will the pic retain the values that were written to the eeprom when the device is turned back on say 1 hour to several weeks?
Isn't it called "facepalm"!!*head smack*
Isn't it called "facepalm"!!
ran across an artical about using eeprom and it mentioned lifespan of writing to much. will reconsider
what got me to consider using the eeprom was in the tetris code from the diy electronics site by Graham Mitchell.
Maybe reconsider but??
what got me to consider using the eeprom was in the tetris code from the diy electronics site by Graham Mitchell.
Maybe reconsider but??
Sub ET_time()
Timer.Stop //stop timer
s=DecToStr(ms/1000)+"."+DecToStr((ms Mod 1000)) //this result to be written to eeprom
WriteAt(1,1,"reaction ")
WriteAt(2,1,"seconds ",s," ")
DelayMS(3000)
'END SUB
ms=0
Cls
DelayMS(1000)
'repeat
' WriteAt(1,1,"press START")
'WriteAt(2,1,"to play again")
'until (getkey()=3)
'DelayMS(2000)
Cls
'DelayMS(100)
'wend
End Sub
Sub ReadHighScore()//grab the desired score
Dim tmpByte As Byte
Dim LastHighScore As Word
EE.Read(0,tmpByte)
If tmpByte = $77 Then
EE.Read(1,LastHighScore)
ShowScore(LastHighScore)
Else
LastHighScore = 0
EE.Write(0,$77,LastHighScore)
ShowScore(LastHighScore)
EndIf
End Sub
Sub WriteHighScore() //write desired score to eeprom and display it
Dim LastHighScore As Word
EE.Read(1,LastHighScore)
If NumberOfLines > LastHighScore Then
EE.Write(1,NumberOfLines)
EndIf
End Sub
you win a chocolate cigar mr goodwin!
//zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Sub Present_Score()
Dim LastLOWScore As Word
EE.Read(1,LastLOWScore) //read the eeprom
If Prev_score < LastLOWscore Then //COMPARE LOW AND PRESENT SCORE ON EEPROM
EE.Write(1,Prev_score)
cls //write previous lowscore to eeprom
writeat(1,1,"last score",Prev_score) //susposed to show what Prev_score is (write to eeprom
delayms(2000)
EndIf
End Sub
//read eeprom for lastLOWscore
//if Prev_score is lower than lastLOWscore then Prev_score needs to become lastLOWscore written to eeprom
Sub ReadScore()
Dim tmpByte As Byte
Dim LastLOWScore As Word
EE.Read(0,tmpByte)
If tmpByte = $77 Then
EE.Read(1,LastLOWScore) //READ LASTLOWSCORE ON EEPROM
cls
WriteAt(1,1,"YOUR SCORE")
WriteAt(2,1,"SECONDS ",s," " ) //showscore(LastLOWScore)ON LCD
delayms(2000)
Else
LastlowScore = 0
EE.Write(0,$77,LastLOWScore)
WriteAt(1,1,"lOWEST SCORE")
WriteAt(2,1,DecToStr(Prev_score)) //showscore(LastLOWScore)
EndIf
End Sub