mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-21 11:36:43 +00:00
Created Hardware: LiDAR (markdown)
parent
110ce1d588
commit
47bc6747c9
35
Hardware:-LiDAR.md
Normal file
35
Hardware:-LiDAR.md
Normal file
@ -0,0 +1,35 @@
|
||||
Bexsh Optics's LiDAR device is used to accurately map the area around your Cubot. It is equipped with an on board path finding module and is able to detect underground resources such as iron or copper.
|
||||
|
||||
### Specifications
|
||||
Manufacturer: Bexsh Optics
|
||||
Version: 1.0B
|
||||
Default address: `0x0003`
|
||||
Hardware ID: `0x0003`
|
||||
|
||||
### Interrupt Behavior
|
||||
| Value of A | Action | Energy cost | Result |
|
||||
| --- | --- | --- | --- |
|
||||
| `1` | `GET_POS` | `0 kJ` | Get the current (x,y) coordinates in the World |
|
||||
| `2` | `GET_PATH` | `50 kJ` | Calculate the shortest path to the specified coordinates and copy it to memory|
|
||||
| `3` | `GET_MAP` | `10 kJ` | Generate the current World's map and copy it to memory |
|
||||
|
||||
`GET_PATH` Generates a path as a direction sequence of 1 word each starting at memory address `0x0000`
|
||||
`GET_MAP` Generates a map of the current world as a tile sequence of 256 words starting at memory address `0x0100`, each word representing a tile. The LiDAR starts reading the tiles west to east, north to south: (0,0) (1,0) (2,0) ... (15,0) (0,1) (1,1) ...
|
||||
|
||||
Each tile is is encoded as a bit field:
|
||||
`1000 0000 0000 0000` (`0x8000`) : Blocked (wall) tile
|
||||
`0100 0000 0000 0000` (`0x4000`) : Biomass
|
||||
`0010 0000 0000 0000` (`0x2000`) :
|
||||
`0001 0000 0000 0000` (`0x1000`) :
|
||||
`0000 1000 0000 0000` (`0x0800`) :
|
||||
`0000 0100 0000 0000` (`0x0400`) :
|
||||
`0000 0010 0000 0000` (`0x0200`) : Iron tile
|
||||
`0000 0001 0000 0000` (`0x0100`) : Copper tile
|
||||
`0000 0000 1000 0000` (`0x0080`) : Cubot
|
||||
`0000 0000 0100 0000` (`0x0040`) :
|
||||
`0000 0000 0010 0000` (`0x0020`) :
|
||||
`0000 0000 0001 0000` (`0x0010`) :
|
||||
`0000 0000 0000 1000` (`0x008`) :
|
||||
`0000 0000 0000 0100` (`0x004`) :
|
||||
`0000 0000 0000 0010` (`0x002`) :
|
||||
`0000 0000 0000 0001` (`0x001`) :
|
Loading…
x
Reference in New Issue
Block a user