more ranged for

This commit is contained in:
Emil Lerch 2023-03-29 09:21:19 -07:00
parent 23b79b5e58
commit 3ed7cad6ce
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -120,10 +120,11 @@ fn sendPixelsThroughI2CDriver(pixels: []const u8, file: [*:0]const u8, device_id
// Write data to device
try i2cWrite(&i2c, &pixels_write_command);
var i: usize = 0;
while (i < HEIGHT) {
// var i: usize = 0;
// while (i < HEIGHT) {
for (0..HEIGHT) |i| {
std.debug.print("{d:0>2}: {s}\n", .{ i, fmtSliceGreyscaleImage(pixels[(i * WIDTH)..((i + 1) * WIDTH)]) });
i += 1;
// i += 1;
}
}