Skip to content

antlanc7/Zig-Arduino-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Zig Arduino Project on Windows

Thanks to @dannypsnl for the original avr-arduino-zig repo and the guide on how to use it.
Working with Zig version 0.9.1 stable on Windows.
It uses Zigmod to download the avr-arduino-zig fork as dependency.
Avrdude is needed to be available in the PATH to flash the binary to the Arduino. If you have installed Arduino IDE you can find it in the C:\Program Files (x86)\Arduino\hardware\tools\avr\bin folder.

  • zigmod fetch to get the dependencies
  • zig build to build the binary
  • zig build upload to flash the binary to the Arduino

If you get an error like this:

.\deps.zig:70:40: error: no member named 'source' in struct 'std.build.Pkg'
        .pkg = Pkg{ .name = "arduino", .source = .{ .path = dirs._ie76bs50j4tl ++ "/src/arduino.zig" }, .dependencies = null },

you have to manually modify the generated deps.zig file and change the source field to path:

    .pkg = Pkg{ .name = "arduino", .path = .{ .path = dirs._ie76bs50j4tl ++ "/src/arduino.zig" }, .dependencies = null },

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages