uni

Thing1's amazing uni repo
Log | Files | Refs

27.10.25.md (1042B)


      1 27/10/25
      2 ========
      3 
      4 Numeric Literals
      5 ----------------
      6 
      7 - numbers can be followed by the letters `f`, `L`, `UL` or some other things, to specify the type
      8 - numbers can be sepcified in dec, oct, hex, bin
      9     - `0324` is oct
     10     - `0xF3` is hex
     11     - `0b010101` is bin
     12 - numbers can be secified in scientific notation like so, `1.532e23`
     13 
     14 
     15 Permanent Storage
     16 -----------------
     17 
     18 - EEPROM is a tiny hard-drive
     19 
     20 - `#include <EEPROM.h>`
     21 - `byte read(int addr)`
     22 - `void write(int addr, byte value)`
     23 - `void update(int addr, byte value)`
     24 - `int length()`
     25 
     26 - update is better the write
     27 
     28 - Some preprocessor trickery could be used to make this work like a memory allocator
     29 
     30 - the EEPROM can be used as an array, called `EEPROM`
     31     - this would be nicer for the preprocessor trickery
     32 
     33 - someone else already did this
     34     - `put(int addr, value)`
     35     - `get(int addr, value)`
     36     - these are most likely defined as overloaded functions, not pre processor macros, meaning structs wont work
     37     - get is doing some wacky c++ stuff to not require an `&`
     38