write to peripheral implemented