/* Project: 3x3x3 Mono LED Cube (r3).
 * File: MVBoxy.cpp
 * Description:
 *     Movie -- mv_Boxy
 *         Randonly display a growing and shrinking box.
 *         (as well as you can do in 3x3x3).
 *
 * Copyright (C) 2014 Marc Symonds
 * All rights reserved.
 *
 * This software may be used and redistributed, with or without
 * modification, as long as it is understood that this software
 * is provided as-is without any explicit or implied warranties
 * of merchantablity or fitness of purpose.
 */

#include "Arduino.h"
#include "Movies.h"
#include "DisplayFrame.h"

void mv_Boxy()
{
  unsigned long ts;
  unsigned long tbox = 1; // 0xB000000000000000000000000001;
  unsigned long sbox = 13851; //0XB000000000000011011000011011;
  unsigned long lbox = 129948655; //0XB111101111101101101111101111;
  int spd;
  POSTransFPtr trans;

  trans = GetPOSTrans(random(0, 8));
  
  ts = millis() + (DEF_MOVIE_TIME / 2);

  while (millis() < ts)
  {
    spd = random(50, 90);
 
    df_DisplayMonoFrame(trans, tbox);   
    delay(spd);
    df_DisplayMonoFrame(trans, sbox);   
    delay(spd);
    df_DisplayMonoFrame(trans, lbox);   
    delay(spd * 4);
    
    trans = GetPOSTrans(random(0, 8));
    df_DisplayMonoFrame(trans, sbox);
    delay(spd);
    df_DisplayMonoFrame(trans, tbox);
    delay(spd);
    df_clear();
    
    delay(spd);
  }
}

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Spam Blocker