Merkwürdiges Problem mit Array

Hallo :slight_smile:
Ich versuche gerade ein Fond Array auszulesen.

uint8_t FONT_8X4 []= {
  0b00000000,                                                   // SPACE
  0b01110000, 0b11111101, 0b01110000,                           // !
  0b11000000, 0b00000000, 0b11000000,                           // "
  0b00100100, 0b11111111, 0b00100100, 0b11111111, 0b00100100,   // #
  0b00100100, 0b01010010, 0b11011011, 0b01001010, 0b00100100,   // $
  0b11000001, 0b11000110, 0b00011000, 0b01100011, 0b10000011,   // %
  0b01101110, 0b10010001, 0b10010010, 0b01100101,               // &
  0b11000000,                                                   // '
  0b00111100, 0b01000010, 0b10000001,                           // (
  0b10000001, 0b01000010, 0b00111100,                           // )
  0b10100000, 0b01000000, 0b10100000,                           // *
  0b00001000, 0b00001000, 0b00111110, 0b00001000, 0b00001000,   // +
  0b00000001, 0b00000010,                                       // ,
  0b00001000, 0b00001000, 0b00001000,                           // -
  0b00000001,                                                   // .
  0b00000011, 0b00001100, 0b00110000, 0b11000000,               // /
  0b01111110, 0b10110001, 0b10001101, 0b01111110,               // 0
  0b01000001, 0b11111111, 0b00000001,                           // 1
  0b01000011, 0b10000101, 0b10001001, 0b01110001,               // 2
  0b01000010, 0b10001001, 0b10001001, 0b01110110,               // 3
  0b00011100, 0b00100100, 0b01001111, 0b10000100,               // 4
  0b11110001, 0b10010001, 0b10010001, 0b10001110,               // 5
  0b01111110, 0b10001001, 0b10001001, 0b01000110,               // 6
  0b10000000, 0b10000111, 0b10011000, 0b11100000,               // 7
  0b01110110, 0b10001001, 0b10001001, 0b01110110,               // 8
  0b01110010, 0b10001001, 0b10001001, 0b01111110,               // 9
  0b00100010,                                                   // :
  0b00000001, 0b00100010,                                       // ;
  0b00011000, 0b00100100, 0b01000010, 0b10000001,               // <
  0b00010100, 0b00010100, 0b00010100, 0b00010100,               // =
  0b10000001, 0b01000010, 0b00100100, 0b00011000,               // >
  0b01000000, 0b10001101, 0b10001000, 0b01110000,               // ?
  0b01111110, 0b10000001, 0b10111001, 0b10000101, 0b01111100,   // @
  0b01111111, 0b10001000, 0b10001000, 0b01111111,               // A
  0b11111111, 0b10001001, 0b10001001, 0b01110110,               // B
  0b01111110, 0b10000001, 0b10000001, 0b01000010,               // C
  0b11111111, 0b10000001, 0b10000001, 0b01111110,               // D
  0b11111111, 0b10001001, 0b10001001, 0b10000001,               // E
  0b11111111, 0b10010000, 0b10010000, 0b10000000,               // F
  0b01111110, 0b10000001, 0b10001001, 0b01001110,               // G
  0b11111111, 0b00001000, 0b00001000, 0b11111111,               // H
  0b10000001, 0b11111111, 0b10000001,                           // I
  0b10000110, 0b10000001, 0b10000001, 0b11111110,               // J
  0b11111111, 0b00010000, 0b00101000, 0b11000111,               // K
  0b11111111, 0b00000001, 0b00000001, 0b00000001,               // L
  0b01111111, 0b11000000, 0b00110000, 0b11000000, 0b01111111,   // M
  0b11111111, 0b01100000, 0b00011000, 0b00000110, 0b11111111,   // N
  0b01111110, 0b10000001, 0b10000001, 0b01111110,               // O
  0b11111111, 0b10001000, 0b10001000, 0b01110000,               // P
  0b01111110, 0b10000001, 0b10000101, 0b10000010, 0b01111101,   // Q
  0b11111111, 0b10001000, 0b10001100, 0b01110011,               // R
  0b01100010, 0b10010001, 0b10001001, 0b01000110,               // S
  0b10000000, 0b11111111, 0b10000000,                           // T
  0b11111110, 0b00000001, 0b00000001, 0b11111110,               // U
  0b11111110, 0b00000001, 0b00000110, 0b11111000,               // V
  0b11111100, 0b00000011, 0b00011100, 0b00000011, 0b11111100,   // W
  0b10000001, 0b01100110, 0b00011000, 0b01100110, 0b10000001,   // X
  0b11000000, 0b00110000, 0b00001111, 0b00110000, 0b11000000,   // Y
  0b10000011, 0b10001101, 0b10110001, 0b11000001,               // Z
  0b11111111, 0b10000001,                                       // [
  0b11000000, 0b00110000, 0b00001100, 0b00000011,               // \
  0b10000001, 0b11111111,                                       // ]
  0b01000000, 0b10000000, 0b01000000,                           // ^
  0b00000001, 0b00000001, 0b00000001, 0b00000001,               // _
};



void setup() {
Serial.begin(115200);
for (int16_t i=0 ; i < 237; i++){
prntBits(FONT_8X4[i]);
Serial.print("Value:");Serial.println(FONT_8X4[i]);
Serial.print("Bytecounter:");Serial.println(i);
  
  }
}

void loop() {
  // put your main code here, to run repeatedly:

}

void prntBits(byte b)
{
  for(int i = 7; i >= 0; i--)
    Serial.print(bitRead(b,i));
  Serial.println();  
}

Das ist meine Ausgabe:

00000000
Value:0
Bytecounter:0
01110000
Value:112
Bytecounter:1
11111101
Value:253
Bytecounter:2
01110000
Value:112
Bytecounter:3
11000000
Value:192
Bytecounter:4
00000000
Value:0
Bytecounter:5
11000000
Value:192
Bytecounter:6
00100100
Value:36
Bytecounter:7
11111111
Value:255
Bytecounter:8
00100100
Value:36
Bytecounter:9
11111111
Value:255
Bytecounter:10
00100100
Value:36
Bytecounter:11
00100100
Value:36
Bytecounter:12
01010010
Value:82
Bytecounter:13
11011011
Value:219
Bytecounter:14
01001010
Value:74
Bytecounter:15
00100100
Value:36
Bytecounter:16
11000001
Value:193
Bytecounter:17
11000110
Value:198
Bytecounter:18
00011000
Value:24
Bytecounter:19
01100011
Value:99
Bytecounter:20
10000011
Value:131
Bytecounter:21
01101110
Value:110
Bytecounter:22
10010001
Value:145
Bytecounter:23
10010010
Value:146
Bytecounter:24
01100101
Value:101
Bytecounter:25
11000000
Value:192
Bytecounter:26
00111100
Value:60
Bytecounter:27
01000010
Value:66
Bytecounter:28
10000001
Value:129
Bytecounter:29
10000001
Value:129
Bytecounter:30
01000010
Value:66
Bytecounter:31
00111100
Value:60
Bytecounter:32
10100000
Value:160
Bytecounter:33
01000000
Value:64
Bytecounter:34
10100000
Value:160
Bytecounter:35
00001000
Value:8
Bytecounter:36
00001000
Value:8
Bytecounter:37
00111110
Value:62
Bytecounter:38
00001000
Value:8
Bytecounter:39
00001000
Value:8
Bytecounter:40
00000001
Value:1
Bytecounter:41
00000010
Value:2
Bytecounter:42
00001000
Value:8
Bytecounter:43
00001000
Value:8
Bytecounter:44
00001000
Value:8
Bytecounter:45
00000001
Value:1
Bytecounter:46
00000011
Value:3
Bytecounter:47
00001100
Value:12
Bytecounter:48
00110000
Value:48
Bytecounter:49
11000000
Value:192
Bytecounter:50
01111110
Value:126
Bytecounter:51
10110001
Value:177
Bytecounter:52
10001101
Value:141
Bytecounter:53
01111110
Value:126
Bytecounter:54
01000001
Value:65
Bytecounter:55
11111111
Value:255
Bytecounter:56
00000001
Value:1
Bytecounter:57
01000011
Value:67
Bytecounter:58
10000101
Value:133
Bytecounter:59
10001001
Value:137
Bytecounter:60
01110001
Value:113
Bytecounter:61
01000010
Value:66
Bytecounter:62
10001001
Value:137
Bytecounter:63
10001001
Value:137
Bytecounter:64
01110110
Value:118
Bytecounter:65
00011100
Value:28
Bytecounter:66
00100100
Value:36
Bytecounter:67
01001111
Value:79
Bytecounter:68
10000100
Value:132
Bytecounter:69
11110001
Value:241
Bytecounter:70
10010001
Value:145
Bytecounter:71
10010001
Value:145
Bytecounter:72
10001110
Value:142
Bytecounter:73
01111110
Value:126
Bytecounter:74
10001001
Value:137
Bytecounter:75
10001001
Value:137
Bytecounter:76
01000110
Value:70
Bytecounter:77
10000000
Value:128
Bytecounter:78
10000111
Value:135
Bytecounter:79
10011000
Value:152
Bytecounter:80
11100000
Value:224
Bytecounter:81
01110110
Value:118
Bytecounter:82
10001001
Value:137
Bytecounter:83
10001001
Value:137
Bytecounter:84
01110110
Value:118
Bytecounter:85
01110010
Value:114
Bytecounter:86
10001001
Value:137
Bytecounter:87
10001001
Value:137
Bytecounter:88
01111110
Value:126
Bytecounter:89
00100010
Value:34
Bytecounter:90
00000001
Value:1
Bytecounter:91
00100010
Value:34
Bytecounter:92
00011000
Value:24
Bytecounter:93
00100100
Value:36
Bytecounter:94
01000010
Value:66
Bytecounter:95
10000001
Value:129
Bytecounter:96
00010100
Value:20
Bytecounter:97
00010100
Value:20
Bytecounter:98
00010100
Value:20
Bytecounter:99
00010100
Value:20
Bytecounter:100
10000001
Value:129
Bytecounter:101
01000010
Value:66
Bytecounter:102
00100100
Value:36
Bytecounter:103
00011000
Value:24
Bytecounter:104
01000000
Value:64
Bytecounter:105
10001101
Value:141
Bytecounter:106
10001000
Value:136
Bytecounter:107
01110000
Value:112
Bytecounter:108
01111110
Value:126
Bytecounter:109
10000001
Value:129
Bytecounter:110
10111001
Value:185
Bytecounter:111
10000101
Value:133
Bytecounter:112
01111100
Value:124
Bytecounter:113
01111111
Value:127
Bytecounter:114
10001000
Value:136
Bytecounter:115
10001000
Value:136
Bytecounter:116
01111111
Value:127
Bytecounter:117
11111111
Value:255
Bytecounter:118
10001001
Value:137
Bytecounter:119
10001001
Value:137
Bytecounter:120
01110110
Value:118
Bytecounter:121
01111110
Value:126
Bytecounter:122
10000001
Value:129
Bytecounter:123
10000001
Value:129
Bytecounter:124
01000010
Value:66
Bytecounter:125
11111111
Value:255
Bytecounter:126
10000001
Value:129
Bytecounter:127
10000001
Value:129
Bytecounter:128
01111110
Value:126
Bytecounter:129
11111111
Value:255
Bytecounter:130
10001001
Value:137
Bytecounter:131
10001001
Value:137
Bytecounter:132
10000001
Value:129
Bytecounter:133
11111111
Value:255
Bytecounter:134
10010000
Value:144
Bytecounter:135
10010000
Value:144
Bytecounter:136
10000000
Value:128
Bytecounter:137
01111110
Value:126
Bytecounter:138
10000001
Value:129
Bytecounter:139
10001001
Value:137
Bytecounter:140
01001110
Value:78
Bytecounter:141
11111111
Value:255
Bytecounter:142
00001000
Value:8
Bytecounter:143
00001000
Value:8
Bytecounter:144
11111111
Value:255
Bytecounter:145
10000001
Value:129
Bytecounter:146
11111111
Value:255
Bytecounter:147
10000001
Value:129
Bytecounter:148
10000110
Value:134
Bytecounter:149
10000001
Value:129
Bytecounter:150
10000001
Value:129
Bytecounter:151
11111110
Value:254
Bytecounter:152
11111111
Value:255
Bytecounter:153
00010000
Value:16
Bytecounter:154
00101000
Value:40
Bytecounter:155
11000111
Value:199
Bytecounter:156
11111111
Value:255
Bytecounter:157
00000001
Value:1
Bytecounter:158
00000001
Value:1
Bytecounter:159
00000001
Value:1
Bytecounter:160
01111111
Value:127
Bytecounter:161
11000000
Value:192
Bytecounter:162
00110000
Value:48
Bytecounter:163
11000000
Value:192
Bytecounter:164
01111111
Value:127
Bytecounter:165
11111111
Value:255
Bytecounter:166
01100000
Value:96
Bytecounter:167
00011000
Value:24
Bytecounter:168
00000110
Value:6
Bytecounter:169
11111111
Value:255
Bytecounter:170
01111110
Value:126
Bytecounter:171
10000001
Value:129
Bytecounter:172
10000001
Value:129
Bytecounter:173
01111110
Value:126
Bytecounter:174
11111111
Value:255
Bytecounter:175
10001000
Value:136
Bytecounter:176
10001000
Value:136
Bytecounter:177
01110000
Value:112
Bytecounter:178
01111110
Value:126
Bytecounter:179
10000001
Value:129
Bytecounter:180
10000101
Value:133
Bytecounter:181
10000010
Value:130
Bytecounter:182
01111101
Value:125
Bytecounter:183
11111111
Value:255
Bytecounter:184
10001000
Value:136
Bytecounter:185
10001100
Value:140
Bytecounter:186
01110011
Value:115
Bytecounter:187
01100010
Value:98
Bytecounter:188
10010001
Value:145
Bytecounter:189
10001001
Value:137
Bytecounter:190
01000110
Value:70
Bytecounter:191
10000000
Value:128
Bytecounter:192
11111111
Value:255
Bytecounter:193
10000000
Value:128
Bytecounter:194
11111110
Value:254
Bytecounter:195
00000001
Value:1
Bytecounter:196
00000001
Value:1
Bytecounter:197
11111110
Value:254
Bytecounter:198
11111110
Value:254
Bytecounter:199
00000001
Value:1
Bytecounter:200
00000110
Value:6
Bytecounter:201
11111000
Value:248
Bytecounter:202
11111100
Value:252
Bytecounter:203
00000011
Value:3
Bytecounter:204
00011100
Value:28
Bytecounter:205
00000011
Value:3
Bytecounter:206
11111100
Value:252
Bytecounter:207
10000001
Value:129
Bytecounter:208
01100110
Value:102
Bytecounter:209
00011000
Value:24
Bytecounter:210
01100110
Value:102
Bytecounter:211
10000001
Value:129
Bytecounter:212
11000000
Value:192
Bytecounter:213
00110000
Value:48
Bytecounter:214
00001111
Value:15
Bytecounter:215
00110000
Value:48
Bytecounter:216
11000000
Value:192
Bytecounter:217
10000011
Value:131
Bytecounter:218
10001101
Value:141
Bytecounter:219
10110001
Value:177
Bytecounter:220
11000001
Value:193
Bytecounter:221
11111111
Value:255
Bytecounter:222
10000001
Value:129
Bytecounter:223
11000000
Value:192
Bytecounter:224
00110000
Value:48
Bytecounter:225
00001100
Value:12
Bytecounter:226
00000011
Value:3
Bytecounter:227
01000000
Value:64
Bytecounter:228
10000000
Value:128
Bytecounter:229
01000000
Value:64
Bytecounter:230
00000001
Value:1
Bytecounter:231
00000001
Value:1
Bytecounter:232
00000001
Value:1
Bytecounter:233
00000001
Value:1
Bytecounter:234
00001101
Value:13
Bytecounter:235
00001010
Value:10
Bytecounter:236

Wieso läuft es bei Bytecounter 228 schief? Ich bin Ratlos :roll_eyes:
Vielleicht kann das mal eine Probieren ?
Ich Danke euch.

Was soll bei 228 rauskommen und was kommt raus?

wäre cool wenn du uns markieren würdest wo du glaubst dass Byte 228 sein soll.

Außerdem fehlt ein Serial.begin in deinem Code.

Sieht eigenartig aus....

Ich ahbe nur die falsche Brille mit.... Weiss daher nicht, warum die 2 Bytes da nicht genauso dargestellt werden....

Nicht der Inhalt, sondern das Element.

Hallo @zwieblum
Bis 227 läuft alles erwartungsgemäß. Danach passt gar nichts mehr.
Hier steht im Array 0b10000001, 0b11111111,
Es sollte also 01000001 und 11111111 sein. Ich bekomme aber:

01000000
Value:64
Bytecounter:228
10000000
Value:128
Bytecounter:229

Der Rest ist auch nicht zum Array passend. Ich begreife hier nicht mal, was ich falsch mache. :frowning:

Hallo @noiasca
Ja, das serial.begin habe ich im Eifer vergessen. Ich korrigiere das.

Compiling libraries...
C:\Users\werner\AppData\Local\Temp\.arduinoIDE-unsaved202504-11520-14953d6.s0nm\sketch_jan4a\sketch_jan4a.ino:62:65: warning: multi-line comment [-Wcomment]
   0b11000000, 0b00110000, 0b00001100, 0b00000011,               // \
                                                                 ^

lösche den backslash aus den Kommentaren
dann gehts.

  0b11111111, 0b10000001,                                       // [
  0b11000000, 0b00110000, 0b00001100, 0b00000011,               // backslash
  0b10000001, 0b11111111,                                       // ]
  0b01000000, 0b10000000, 0b01000000,                           // ^
  0b00000001, 0b00000001, 0b00000001, 0b00000001,               // _

Schalte dir die Warnings in der IDE ein, dann siehst du sowas gleich.

Hallo @my_xy_projekt
Warum die Stelle 63 eine andere Farbe hat, kann ich nicht erklären.
Das hat aber schon HIER einen andere Farbe. Selbst mein Arduino zeigt es mir in grau an. Diese Zeile nochmal zu schreiben, bringt nix. Es bleibt grau ...
Aber genau da, gehen die Problem los.

@noiasca
Ich Danke Dir recht Herzlich ! Genau das war es. Jetzt funktioniert alles. Da wäre ich niemals drauf gekommen ... :roll_eyes:

Warnings einschalten :wink:

Naja ... das Zeichen hat ja rot geleuchtet, allerdings habe ich darin keinen Fehler gesehen weil es hinter einem // stand. Tja, man lernt nie aus ... Danke !

Nennt sich: line continuation

Aus

  0b11000000, 0b00110000, 0b00001100, 0b00000011,               // \
  0b10000001, 0b11111111,                                       // ]

wird

  0b11000000, 0b00110000, 0b00001100, 0b00000011,               //   0b10000001, 0b11111111,                                       // ]

Welchen Arduino hast Du? Hast Du genug RAM?

Grüße Uwe

Gnihihi..... :grinning:

oder mach einen zweiten daneben.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.