Refactor code for readability
And finally glow the LED :). The problem is with shifting the address before writing to page cache. Now we write to the page buffer , and shift the address when writing to the address register