implemented periodic loop for rgb led control