RCS-10 Arduino Controller

RCS-10 Arduino Controller Blog Post

Advertisements
/*Arduino Mega RCS-10 Control
  https://MacarrLabs.com/
  https://KM4NMP.com/
  Author: Matthew Carr, Macarr Labs LLC 6/8/19
  Arduino Mega Sketch
*/
//Libraries 
#include <Wire.h>  
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

const int UpButtonPin = 22;  //set up button pin
int UpButtonPinState = 0; //up button pin state
const int DownButtonPin = 24;  //set down button pin
int DownButtonPinState = 0;
const int OutputA = 52;  //set output a pin
const int OutputB = 50;  //set output b pin
const int OutputC = 48;  //set output c pin
int RelayNumber = 1;
const int ButtonPwrNegPin = 28; //set pin for button negative
const int ButtonPwrPlusPin = 30; //set pin for button positive
 
void setup() {
  lcd.begin(16,2); //Start LCD
  lcd.backlight(); //Turn LCD Backlight on

  pinMode(ButtonPwrNegPin, OUTPUT);  //initialize the ButtonPwrNegPin as an output
  pinMode(ButtonPwrPlusPin, OUTPUT);  //initialize the ButtonPwrPlusPin as an output
  pinMode(UpButtonPin, INPUT);  //initialize the UpButtonPin as an input
  pinMode(DownButtonPin, INPUT);  //initialize the DownButtonPin as an input
  pinMode(OutputA, OUTPUT);  //initialize the Output A pin as an output
  pinMode(OutputB, OUTPUT);  //initialize the Output B pin as an output
  pinMode(OutputC, OUTPUT);  //initialize the Output C pin as an output

  digitalWrite(ButtonPwrPlusPin, HIGH);
  digitalWrite(ButtonPwrNegPin, LOW);

 lcd.setCursor(0,0);
 lcd.print(" MACARRLABS.COM");
 lcd.setCursor(0,1);
 lcd.print("   KM4NMP.COM");
 delay(3000);
 lcd.clear(); 
}

void loop() {
   //check button states
  UpButtonPinState = digitalRead(UpButtonPin);
  DownButtonPinState = digitalRead(DownButtonPin);
  
  if(UpButtonPinState == HIGH) {
    RelayNumber = RelayNumber + 1;
  }
  if(DownButtonPinState == HIGH) {
    RelayNumber = RelayNumber - 1;
  }
  if(RelayNumber > 8) {  //put a max of 3 for relay number
    RelayNumber = 8;
  }
  if(RelayNumber < 1) {  //put a min of 1 for relay number
    RelayNumber = 1;
  }
  
  //check relay number and activate outputs according to number
if(RelayNumber == 1) {
  lcd.setCursor(0,0);
  lcd.print("Antenna 1");
  digitalWrite(OutputA, LOW);
  digitalWrite(OutputB, LOW);
  digitalWrite(OutputC, LOW);
  }
Advertisements
if(RelayNumber == 2) {
  digitalWrite(OutputA, HIGH);
  digitalWrite(OutputB, LOW);
  digitalWrite(OutputC, LOW);
  lcd.setCursor(0,0);
  lcd.print("Antenna 2");
  }
  
  
if(RelayNumber == 3) {
  digitalWrite(OutputA, LOW);
  digitalWrite(OutputB, HIGH);
  digitalWrite(OutputC, LOW);
  lcd.setCursor(0,0);
  lcd.print("Antenna 3");
  }
 
 
  if(RelayNumber == 4) {
  digitalWrite(OutputA, HIGH);
  digitalWrite(OutputB, HIGH);
  digitalWrite(OutputC, LOW);
  lcd.setCursor(0,0);
  lcd.print("Antenna 4");
  }
  
  if(RelayNumber == 5) {
  digitalWrite(OutputA, LOW);
  digitalWrite(OutputB, LOW);
  digitalWrite(OutputC, HIGH);
  lcd.setCursor(0,0);
  lcd.print("Antenna 5");
  }
  
  if(RelayNumber == 6) {
   digitalWrite(OutputA, HIGH);
  digitalWrite(OutputB, LOW);
  digitalWrite(OutputC, HIGH);
  lcd.setCursor(0,0);
  lcd.print("Antenna 6");
  }

  if(RelayNumber == 7) {
  digitalWrite(OutputA, LOW);
  digitalWrite(OutputB, HIGH);
  digitalWrite(OutputC, HIGH);
  lcd.setCursor(0,0);
  lcd.print("Antenna 7");
  }

  if(RelayNumber == 8) {
  digitalWrite(OutputA, HIGH);
  digitalWrite(OutputB, HIGH);
  digitalWrite(OutputC, HIGH);
  lcd.setCursor(0,0);
  lcd.print("Antenna 8");
  }
  

 delay(150);
  
}
 

Advertisements

Links

https://km4nmp.com/2019/06/08/rcs-10-arduino-controller/

https://km4nmp.com/2019/06/15/rcs-10-arduino-controller-pt2/

https://km4nmp.com/2019/05/19/ameritron-rcs-10-fuse-replacement/

Latest Blog Posts

Advertisements
Advertisements
%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close