From f1418a3c8e58dd59e1b833ac31e3abf5f0772089 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Wed, 10 Feb 2021 20:24:39 +0100 Subject: [PATCH] add comments --- Microcontrollers/opdracht 2.4/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Microcontrollers/opdracht 2.4/main.c b/Microcontrollers/opdracht 2.4/main.c index 1b73113..28d5c48 100644 --- a/Microcontrollers/opdracht 2.4/main.c +++ b/Microcontrollers/opdracht 2.4/main.c @@ -53,14 +53,14 @@ void wait( int ms ) int main( void ) { - DDRA = 0xFF; + DDRA = 0xFF; // set PORTA to all output while (1==1) { // Set index to begin of pattern array int index = 0; - // as long as delay has meaningful content + // loop through the array for (int i = 0; i < sizeof(segments)/sizeof(segments[0]); i++) { // Write data to PORTA @@ -71,6 +71,7 @@ int main( void ) index++; } } + /*we need to free the memory taken up by the array, otherwise it won't clear properly*/ free(segments);