iorodeo avatar iorodeo committed 756e7bb

Added stop.

Comments (0)

Files changed (2)

matlab_serial_interface/PanelsNano.m

          
         function setFrameDt(self,dt)
             % Set the frame dt in ms 
-            if (dt < 1) || (dt > 255)
+            if (dt < 0) || (dt > 255)
                 error('frame dt must be between 1 and 255');
             end
             fwrite(self.dev, char(dt));    
       
     end
     
-end
+end

panels_controller_nano_firmware.pde

 void loop() {
   while (Serial.available() > 0) {
     uint8_t byte = (uint8_t) Serial.read();
-    if (byte > 0) {
+    if (byte >= 0) {
       ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
         maxDelayCnt = byte;
         delayCnt = 0;
       }
     }
   }
-  if (sendFrame == true) {
+  if ((maxDelayCnt > 0) && (sendFrame == true)) {
     Wire.beginTransmission(GENERAL_CALL_ADDRESS); // transmit to all devices
     Wire.send(PATTERN[frame_n],INITIAL_PATTERN_BYTE_COUNT);
     Wire.endTransmission();    // stop transmitting
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.