Hi,
I want to save Karel variables to memory.
The reasons for this are:
1. I want the operators to be able to set points in the program and I want the points to stay even after power loss
2. I want to save the state of the program in power loss and be able to continue from where I left off
I saw in the reference manual that there are two commands that might be useful for this:
%CMOSVARS
%CMOS2SHADOW
Can someone please explain with an example how this works, if this is possible
Save Karel Variables to memory
-
dangalg -
October 28, 2018 at 6:10 AM -
Thread is Resolved
-
-
If you want to save the variable in the CMOS, you should declare your variable using IN CMOS like the shown below.
bVar1 IN CMOS :BOOLEAN
eVar2 IN CMOS :INTEGER
sVar3 IN CMOS :STRING[99]
iVar4 IN CMOS :INTEGER
rVar5 IN CMOS :REALI hope that helps.
-
As soon as I turned the controller on and off the karel position was lost
-
How did you test it?
-
It worked!
Just had to delete the program and re upload it.
Thanks!