// EEPROM File : mem(@no) // return : amount to use (bytes) function mem(no){ var adrs=no*2048; var count=0, n; while(count<2048){ var d=0x50|(((adrs>>16)&1)<<2); i2cw(d,(adrs&0xff00)>>8,adrs&255); i2cr(d,n); if(n==0){ return count; } adrs=adrs+1; count=count+1; } return 0; } log("input @number\n"); var s=input(); log(mem(s)," bytes\n");