i**h 发帖数: 424 | 2 Why 00000100 -> C?
What does 00000011 do?
非专业解答
假设LED电流方向是从01234567 -> abcdefgh
MOV DPTR, #FontData
loop:
MOV R0, P0 ;read current input
CLR C ;clear carry flag
MOV A, 1 ;rowId=0
next_row: ;might need a short delay between rows
MOV R1, DPTR + R0 ;read bitmap from font data
MOV P1, A ;select row
MOV P3, R1 ;light row
RLC A ;rowId++
INC R0 ;next byte... 阅读全帖 |
|
b******b 发帖数: 713 | 3 i will try the brute force way first:
1. create a hashmap, whose key is the sequence of the matrix, e.g. if the
array is: row0[1,2,3,4], row1[5,6,7,8], then key is [1,2,3,4,5,6,7,8], value
is the min step to revert it back to [1,2,3,4,5,6,7,8], put in [1,2,3,4,5,6
,7,8], 0 into the map.
2. write a recursive method,
int min(matrix)
{
if (map.contains(matrix.sequence)) return map.get(...);
opt1 = matrix.copy().swaprow();
int result = Integer.maxValue;;
if (!map.contains(op1))
{
... 阅读全帖 |
|