• georgie h

Prototype - Code update:

Following the delays in receiving parts for my project, I begun to write the code that I will use upon receiving the parts.

//Including the Libraries I will be using
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <Stepper.h>

// Define hardware type, size, and output pins (from the Example code) 
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CS_PIN 3

MD_Parola messages = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);


void setup() {
  // put your setup code here, to run once:

 //Setting the LED Matrix up
 messages.begin();
 messages.displayClear();
 messages.setIntensity(0);

}

void loop() {
  // put your main code here, to run repeatedly:
  if (stepCounter == 10){
     messages.displayText("Hello World", PA_CENTER, 100, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
    //March 2020: It has been announced that the country will go into a National Lockdown and proposals to build student accomodation in Bermondsey Spa have been approved despite almost 400 oppositions from local residents.
  }
  
  if (stepCounter == 20){
    //April 2020: 
  }

 if (stepCounter == 20){
    //May 2020: 
  }
  
 if (stepCounter == 20){
    //June 2020: 
  }

 if (stepCounter == 20){
    //July 2020: 
  }

 if (stepCounter == 20){
    //August 2020: 
  }

 if (stepCounter == 20){
    //September 2020: 
  }

 if (stepCounter == 20){
    //October 2020: 
  }

 if (stepCounter == 20){
    //November 2020: 
  }

 if (stepCounter == 20){
    //December 2020: 
  }

 if (stepCounter == 20){
    //January 2021: 
  }

 if (stepCounter == 20){
    //February 2021: 
  }

 if (stepCounter == 20){
    //March 2021: 
  }
  
  if (stepCounter == 200){
 
  Stepcounter = 0 // full rotation
  }

}

Although I had initially planned on using a state machine, upon speaking to some people who are experienced in using an Arduino they advised that I used a series of if statements to keep count of the steps made by the stepper counter to trigger the messages.


The Libraries I am using for my project are the:

MD_Parola and MD_MAX72xx to control the LED Matrix as shown in a previous blog post: Scrolling LED Matrix - Progress (georgiehodges.com)

I will also be using the Stepper Library which is an Arduino Library as mentioned in another previous blog post:

Stepper Motor Coding (georgiehodges.com)


Until my project pieces arrive, I will be working on developing the final laser cutting files - this will include the engraving designs and finalising the crosshair designs.

6 views0 comments

Recent Posts

See All