Tag Archives | arduino

LED Blink Illumination in Sequential Morse Code

This project involves a simple circuit that involves three LEDs that illuminate in succession to indicate the presence of an SOS signal in Morse Code. The physical set up of the physical set up involves a red, green, and blue LED connected to three separate ports on an Arduino Uno. All share the same ground path and are current-limited by separate 330-ohm resistors. We have here a hardware set up of code to support a (dot, dot, dot, dash, dash, dash, dot, dot, dot) repeating pattern of illumination as a visual indication of messaging (••• – – – •••).

Each dot is a shorter on/off period of time as compared to a longer period for a sequence of three dashes. Following another three dots until the cycle repeats itself after a short delay.


Arduino IDE:

Arduino Code:

int redLED=8;
int greenLED=9;
int blueLED=10;

float pi=3.14;
int dit=100;
int dah=500;
int LongW=2000;

String myName=”[Place Holder]”;

void setup() {
// put setup code here, to run once:
pinMode(redLED,OUTPUT);
}

void loop() {
// put main code here, to run repeatedly:

digitalWrite(redLED,HIGH);
delay(dit);
digitalWrite(redLED,LOW);
delay(dit);

digitalWrite(redLED,HIGH);
delay(dit);
digitalWrite(redLED,LOW);
delay(dit);

digitalWrite(redLED,HIGH);
delay(dit);
digitalWrite(redLED,LOW);
delay(dit);

digitalWrite(greenLED,HIGH);
delay(dit);
digitalWrite(greenLED,LOW);
delay(dit);

digitalWrite(greenLED,HIGH);
delay(dit);
digitalWrite(greenLED,LOW);
delay(dit);

digitalWrite(greenLED,HIGH);
delay(dit);
digitalWrite(greenLED,LOW);
delay(dit);

digitalWrite(blueLED,HIGH);
delay(dit);
digitalWrite(blueLED,LOW);
delay(dit);

digitalWrite(blueLED,HIGH);
delay(dit);
digitalWrite(blueLED,LOW);
delay(dit);

digitalWrite(blueLED,HIGH);
delay(dit);
digitalWrite(blueLED,LOW);
delay(dit);

digitalWrite(redLED,HIGH);
delay(dah);
digitalWrite(redLED,LOW);
delay(dah);

digitalWrite(redLED,HIGH);
delay(dah);
digitalWrite(redLED,LOW);
delay(dah);

digitalWrite(redLED,HIGH);
delay(dah);
digitalWrite(redLED,LOW);
delay(dah);

digitalWrite(greenLED,HIGH);
delay(dah);
digitalWrite(greenLED,LOW);
delay(dah);

digitalWrite(greenLED,HIGH);
delay(dah);
digitalWrite(greenLED,LOW);
delay(dah);

digitalWrite(greenLED,HIGH);
delay(dah);
digitalWrite(greenLED,LOW);
delay(dah);

digitalWrite(blueLED,HIGH);
delay(dah);
digitalWrite(blueLED,LOW);
delay(dah);

digitalWrite(blueLED,HIGH);
delay(dah);
digitalWrite(blueLED,LOW);
delay(dah);

digitalWrite(blueLED,HIGH);
delay(dah);
digitalWrite(blueLED,LOW);
delay(dah);

digitalWrite(redLED,HIGH);
delay(dit);
digitalWrite(redLED,LOW);
delay(dit);

digitalWrite(redLED,HIGH);
delay(dit);
digitalWrite(redLED,LOW);
delay(dit);

digitalWrite(redLED,HIGH);
delay(dit);
digitalWrite(redLED,LOW);
delay(dit);

digitalWrite(greenLED,HIGH);
delay(dit);
digitalWrite(greenLED,LOW);
delay(dit);

digitalWrite(greenLED,HIGH);
delay(dit);
digitalWrite(greenLED,LOW);
delay(dit);

digitalWrite(greenLED,HIGH);
delay(dit);
digitalWrite(greenLED,LOW);
delay(dit);

digitalWrite(blueLED,HIGH);
delay(dit);
digitalWrite(blueLED,LOW);
delay(dit);

digitalWrite(blueLED,HIGH);
delay(dit);
digitalWrite(blueLED,LOW);
delay(dit);

digitalWrite(blueLED,HIGH);
delay(dit);
digitalWrite(blueLED,LOW);
delay(dit);

delay(LongW);

}

Further Project Details: -Paul McWhorter

Continue Reading ·

Frequency Selectability Experiment with Arduino

Here is a short effort to program the control of crystal frequency output. 8MHz as the standing frequency with multipliers asserted one at a time.

This is an experiment to encode in binary a selectable output pulse rate from a 555 timer. Where selected GPIO pins become asserted to set the desired rate. Over an Uno connection with code, I set up a user interface to push millions of pulses through to a defined output. All in a single second each instance. Staring from a single pulse rate with multipliers of 16, 20, 32, and 40. Each one separately is chosen by simply entering what a user wants over a GUI interface.


Continue Reading ·

LED Illumination Control with Arduino Uno

There was an online guide that walks a viewer through how to assign color variable values in code to red, green and blue. To combine each as having relative color strength to produce a mixed color output on an RGB LED. This is a way to prepare unique light color values beyond the conventional LED lights with fixed colors. In this small project, color is programmed within the Arduino IDE and thereafter code loaded into the SBC itself to run the unique color mix.

The code to set up this functionality is set up on Arduino Sketch. To write and edit instructions that determine the operability and behavioral properties of the hardware and circuit.

After declarations and set up, this is what the code looks like.

void loop()
{
Serial.println(“Please input your color choice (red, green or blue): “);
while (Serial.available()==0) {

colorChoice= Serial.readString();

if (colorChoice==”red”)
{analogWrite(redPin,brightness);
analogWrite(bluePin,0);
analogWrite(greenPin,0);
}
if (colorChoice==”green”){
analogWrite(redPin,0);
analogWrite(bluePin,0);
analogWrite(greenPin,brightness);
}
if (colorChoice==”blue”){
analogWrite(redPin,0);
analogWrite(bluePin,brightness);
analogWrite(greenPin,0);
}
if ( colorChoice != “red” && colorChoice != “green” && colorChoice != “blue”) { //test for valid input
Serial.println(“”);
Serial.println(“You have not entered a valid color, please enter red, blue or green”);
Serial.println(“”);
}
}

Continue Reading ·