QWMJB2SWRXJ4MD65UREYYAIRL3MXL77FSR2GNY6ZNYQZ6YG6B2YAC const std = @import("std");const microzig = @import("microzig");const rp2xxx = microzig.hal;const time = rp2xxx.time;// Compile-time pin configurationconst pin_config = rp2xxx.pins.GlobalConfiguration{.GPIO15 = .{.name = "led",.direction = .out,},.GPIO13 = .{.name = "button",.direction = .in,},};const pins = pin_config.pins();pub fn main() !void {pin_config.apply();while (true) {// pins.led.toggle();// time.sleep_ms(250);if (pins.button.read() == 0) {pins.led.put(1);} else {pins.led.put(0);}}}
const std = @import("std");const microzig = @import("microzig");const rp2xxx = microzig.hal;const time = rp2xxx.time;// XXX: no idea how to access the builting led for Pico W from microzig// Compile-time pin configurationconst pin_config = rp2xxx.pins.GlobalConfiguration{.GPIO16 = .{// .name = "led",// .direction = .in,},};// const pins = pin_config.pins();pub fn main() !void {pin_config.apply();rp2xxx.gpio.Pin.set_direction(@enumFromInt(16), .out);while (true) {// pins.led.toggle();// time.sleep_ms(250);rp2xxx.gpio.Pin.put(@enumFromInt(16), 1);time.sleep_ms(1000);rp2xxx.gpio.Pin.put(@enumFromInt(16), 0);time.sleep_ms(1000);}}
.{.name = .pico,.version = "0.0.0",.fingerprint = 0x9ea0cb823844cbb4, // Changing this has security and trust implications..minimum_zig_version = "0.14.1",.dependencies = .{// See `zig fetch --save <url>` for a command-line interface for adding dependencies..microzig = .{// .url = "https://example.com/foo.tar.gz",// .hash = "...",// When this is provided, the package is found in a directory relative to the// build root. In this case the package's hash is irrelevant and therefore not// computed. This field and `url` are mutually exclusive..path = "../microzig",// When this is set to `true`, a package is declared to be lazily// fetched. This makes the dependency only get fetched if it is// actually used.// .lazy = false,},},// Specifies the set of files and directories that are included in this package.// Only files and directories listed here are included in the `hash` that// is computed for this package. Only files listed here will remain on disk// when using the zig package manager. As a rule of thumb, one should list// files required for compilation plus any license(s).// Paths are relative to the build root. Use the empty string (`""`) to refer to// the build root itself.// A directory listed here means that all files within, recursively, are included..paths = .{"build.zig","build.zig.zon","src",// For example...//"LICENSE",//"README.md",},}
const std = @import("std");const microzig = @import("microzig");const MicroBuild = microzig.MicroBuild(.{.rp2xxx = true,});pub fn build(b: *std.Build) void {const mz_dep = b.dependency("microzig", .{});const mb = MicroBuild.init(b, mz_dep) orelse return;const pr11 = mb.add_firmware(.{.name = "pr11",.target = mb.ports.rp2xxx.boards.raspberrypi.pico,.optimize = .ReleaseSmall,.root_source_file = b.path("src/pr11.zig"),});mb.install_firmware(pr11, .{});const pr21 = mb.add_firmware(.{.name = "pr21",.target = mb.ports.rp2xxx.boards.raspberrypi.pico,.optimize = .ReleaseSmall,.root_source_file = b.path("src/pr21.zig"),});mb.install_firmware(pr21, .{});const pr22 = mb.add_firmware(.{.name = "pr22",.target = mb.ports.rp2xxx.boards.raspberrypi.pico,.optimize = .ReleaseSmall,.root_source_file = b.path("src/pr22.zig"),});mb.install_firmware(pr22, .{});// We call this twice to demonstrate that the default binary output for// RP2040 is UF2, but we can also output other formats easily// mb.install_firmware(firmware, .{ .format = .elf });}