This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

Project – Arduino 8 and 4 relay code

When you get your Arduino it is imperative that you start doing some projects with it early on. If you get discouraged at the beginning I believe you’ll do the same thing that I did. You will leave it in a box and completely forget about it. This is my second attempt at toying around with my Arduino and now I have a solid project that I want to do.

Before I plan our my project I wanted to test out some code and at least say that I’ve done something with my Arduino. The code below will cycle through the different number relays on your board and set them to on while turning them off in sequence. The code below is also done for my 8ch relay board but it can be easily modified for a relay board with less.

Note: Make sure you set your relay variable to something you can remember easily so that your code is easy to finish. Also note that if you’re using an Arduino uno like myself the digital pins side starts off with pin 0 and goes up.


// Set Variable name to correspond with arduino pin number.
int RELAY1 = 2;
int RELAY2 = 3;
int RELAY3 = 4;
int RELAY4 = 5;
int RELAY5 = 6;
int RELAY6 = 7;
int RELAY7 = 8;
int RELAY8 = 9;

// This will define the delay time below. you can either use it as a variable like this or put the number down in the code (void loop).
int DELAY1 = 200;

// setting the pins on the arduino to output
void setup() {
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);
pinMode(RELAY5, OUTPUT);
pinMode(RELAY6, OUTPUT);
pinMode(RELAY7, OUTPUT);
pinMode(RELAY8, OUTPUT);
}

// main loop. the code here will cycle over and over
void loop() {
digitalWrite(RELAY1, HIGH);
delay(DELAY1);
digitalWrite(RELAY1, LOW);
delay(DELAY1);
digitalWrite(RELAY2, HIGH);
delay(DELAY1);
digitalWrite(RELAY2, LOW);
delay(DELAY1);
digitalWrite(RELAY3, HIGH);
delay(DELAY1);
digitalWrite(RELAY3, LOW);
delay(DELAY1);
digitalWrite(RELAY4, HIGH);
delay(DELAY1);
digitalWrite(RELAY4, LOW);
delay(DELAY1);
digitalWrite(RELAY5, HIGH);
delay(DELAY1);
digitalWrite(RELAY5, LOW);
delay(DELAY1);
digitalWrite(RELAY6, HIGH);
delay(DELAY1);
digitalWrite(RELAY6, LOW);
delay(DELAY1);
digitalWrite(RELAY7, HIGH);
delay(DELAY1);
digitalWrite(RELAY7, LOW);
delay(DELAY1);
digitalWrite(RELAY8, HIGH);
delay(DELAY1);
digitalWrite(RELAY8, LOW);
delay(DELAY1);
}

November 22nd, 2015|Categories: Arduino|Tags: , , , |0 Comments

Leave A Comment