passing an array
Jonathan
Posts: 1,023
Hi All,
Working on a garden timer to integrate into my control system. I am having trouble with a simple array pass, my Spin is a little rusty. All I am doing is writing/reading timer settings to the eeprom. What am I doing wrong here?
byte timer1[10]
set_timer(@timer1,timer1addy) // call method
pub set_timer(pointer,timerAddy)| i
eeprom.writebyte(eeScl,eeAdr,timerAddy+i,pointer)
Hope the code comes out. I haven't figured out how to post code since it went weird. It all works fine if I substitute "timer1" for "pointer" I have the same problem with the read method.
Thanks!
Jonathan
Working on a garden timer to integrate into my control system. I am having trouble with a simple array pass, my Spin is a little rusty. All I am doing is writing/reading timer settings to the eeprom. What am I doing wrong here?
byte timer1[10]
set_timer(@timer1,timer1addy) // call method
pub set_timer(pointer,timerAddy)| i
eeprom.writebyte(eeScl,eeAdr,timerAddy+i,pointer)
Hope the code comes out. I haven't figured out how to post code since it went weird. It all works fine if I substitute "timer1" for "pointer" I have the same problem with the read method.
Thanks!
Jonathan
Comments
So, you can't use pointer on it...
I think you can do:
byte[pointer]
in place of pointer though.
Udaman! Works as desired. I don't really get why, but that can be a mystery for another day. Thanks for the fast reply, took a bio break and came back to the answer!
Jonathan