# Blinking LED 

<abstract>
List of blinking led examples with Fox Board D27
</abstract>

## Blink example in Node

Install Node @article='foxd27_node'

Install the node-libgpiod

	sudo apt update
	sudo apt install libgpiod-dev
	npm i node-libgpiod
	
Save this code in blink.js

	const { version, Chip, Line } = require("node-libgpiod");
	
	global.chip = new Chip(0);
	global.line = new Line(chip, 32); // PB0 line
	
	line.requestOutputMode();
	
	var count=0;
	const blink = () => {
	    line.setValue(count-- % 2);
	    setTimeout(blink,1000);
	};
	
	setTimeout(blink,1000);

Launch it:

	sudo node blink