diff projects/basic_blink/render.cpp @ 75:8bd351ca8b46

Fixed direction in setPinMode functions, updated and fixed basic_blink
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 17 Jul 2015 20:59:43 +0100
parents 0598731d3bef
children ff0f776415e4
line wrap: on
line diff
--- a/projects/basic_blink/render.cpp	Fri Jul 17 20:23:38 2015 +0100
+++ b/projects/basic_blink/render.cpp	Fri Jul 17 20:59:43 2015 +0100
@@ -1,9 +1,3 @@
-    /*
- *
- * Andrew McPherson and Victor Zappi
- * Queen Mary, University of London
- */
-
 #include <BeagleRT.h>
 #include <Utilities.h>
 #include <cmath>
@@ -28,9 +22,13 @@
 // ADCs and DACs (if available). If only audio is available, numAnalogFrames
 // will be 0.
 
+/* basic_blink
+* Connect an LED in series with a 470ohm resistor between P8_07 and ground.
+* The LED will blink every @interval seconds.
+*/
+
 void render(BeagleRTContext *context, void *userData)
 {
-  //connect an LED in series with a 470ohm resistor between P8_07 and ground
   static int count=0; //counts elapsed samples
   float interval=0.5; //how often to toggle the LED (in seconds)
   static int status=GPIO_LOW;
@@ -42,11 +40,9 @@
         status=GPIO_HIGH;
       else
         status=GPIO_LOW;
-      pinModeFrame(context, 0, P8_07, OUTPUT);
-      digitalWriteFrame(context, n, P8_07, status); //write the status to the LED
-    // rt_printf("there %d\n", context->digital[n]);
+      pinModeFrame(context, n, P8_07, OUTPUT);
+      digitalWriteFrameOnce(context, n, P8_07, status); //write the status to the LED
     }
-    context->digital[n]=status*0x00010000;
     count++;
   }
 }