1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | // String(adrs) function String(a){ this .adrs=a; // EEPROM Address this .set= function (idx,n){ // Set Char var adrs= this .adrs+idx; // EEPROM Address+Index i2cw(0x50|(((adrs>>16)&1)<<2), (adrs&0xff00)>>8,adrs&0xff,n&0xFF); }; this .charAt= function (idx){ // Get Char var c,adrs= this .adrs+idx; // EEPROM Address+Index var d=0x50|(((adrs>>16)&1)<<2); i2cw(d,(adrs&0xff00)>>8,adrs&255); i2cr(d,c); return c; }; } // Sample Code var text= new String(1*2048); var s=0; while (s<10){ var c=text.charAt(s); sleep(10); // Wait log(chr(c)); s=s+1; } log( "\n" ); |