7 lines
638 B
Text
7 lines
638 B
Text
//! title: A Linux board reads an I2C sensor and lights an LED
|
|
//! description: flowRS's Linux target (codegen::linux::demo_graph): register 0 of the sensor at I2C address 72 on bus 1 is read and printed, and GPIO 17 is driven high. Exported with --linux, the program runs on the board through flowrs-device, which the project carries in vendor/ with flowrs-hal and flowrs-transport.
|
|
let n0 = IntLiteral { value: 0 };
|
|
let n1 = embedded.i2c.read(register: n0.value) { bus: 1, address: 72, length: 2 };
|
|
let n2 = PrintLn(input: n1.data);
|
|
let n3 = BoolLiteral { value: true };
|
|
let n4 = embedded.gpio.digital_out(state: n3.value) { pin: 17 };
|