Heres a copy of my program I have been able to determine its matrix.begin(); which is causing me the grief but i need that for use on the led display.
Thanks for your help
#include <Servo.h>
#include <RGBmatrixPanel.h>
#include <Adafruit_GFX.h>
#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr
#define CLK 11
#define LAT A3
#define OE 9
#define A A0
#define B A1
#define C A2
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
Servo vert, hori; // create servo object to control a servo
int poshori = 100, posvert = 9, laser = 52, up = 7, down = 6, left = 5, right = 4, fire = 2, select = 3;
void setup() {
matrix.begin();
Serial.begin(57600);
digitalWrite(laser, HIGH);
matrix.setTextWrap(false); // Allow text to run off right edge
matrix.setTextSize(2);
pinMode(laser, OUTPUT); // attaches laser to pin 10
pinMode(up, INPUT_PULLUP); // attaches input to pin 7
pinMode(down, INPUT_PULLUP); // attaches input to pin 6
pinMode(left, INPUT_PULLUP); // attaches input to pin 5
pinMode(right, INPUT_PULLUP); // attaches input to pin 4
vert.write(0);
hori.write(0);
hori.attach(13); // attaches the servo on pin 12 for vertical movement
vert.attach(12); // attaches the servo on pin 12 for vertical movement
}
void loop() {
// Up Push button
if (digitalRead(up) == LOW)
{
posvert -= 2; // in steps of 1 degrees
vert.write(posvert); // tell servo to go to position in variable 'posvert'
delay(250); // Delay to stop bouncing of input
}
// Down Push button
if (digitalRead(down) == LOW)
{
posvert += 2; // in steps of 1 degrees
vert.write(posvert); // tell servo to go to position in variable 'posvert'
delay(250); // Delay to stop bouncing of input
}
// Left Push Button
if (digitalRead(left) == LOW)
{
poshori += 2; // in steps of 1 degrees
hori.write(poshori); // tell servo to go to position in variable 'poshori'
delay(250); // Delay to stop bouncing of input
}
// Right Push Button
if (digitalRead(right) == LOW)
{
poshori -= 2; // in steps of 1 degrees
hori.write(poshori); // tell servo to go to position in variable 'poshori'
delay(250);
}
}