Skip to content

ctfhacker/spintronics-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Programmatic Spintronics

Spintronics is an amazing product where kids of all ages can learn how circuits work using physical gears and chains. They offer a variety of challenges as well as an online simulator to test circuits before physically building them.

This repository attempts to create an API to programmatically generate these simulation files.

Example

use spintronics::*;

fn main() {
    let mut circuit = Circuit::new();
 
    let motor = circuit.motor();
    let r1 = circuit.resistor(1000);
    let r2 = circuit.resistor(200);
    let r3 = circuit.resistor(500);

    circuit.connect(&[motor, r1]);
    circuit.connect(&[motor, r2, r3]);

    circuit.save("/home/user/test.spin");
}

Output

Load the /home/user/test.spin simulation file in the simulator:

pic

About

Programatic generation of Spintronics simulator save files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published