Morse
DSNA 22
Button
LED
Lets Send som Morse code and light related LEDS
Learn More →
// Summary: This program is simulation to Morse code we send dots and dashes
// we ganna use 3 functions :
// 1) dot() : that that buzz and light the related led
//
// 2) dash() : that buzz longer and light another led
// 3) Which_Button : that return which Button we presed ( BLue button for //Dot , Red for dash)
// the Leds : Green when send a dot , Red when send a dash.
//
// The sound : 2 diferent Melodies for dot and for dash.
//
// Version: 1.0
// Owner: Ammar alnahhas
// ---------------------------------------------------------------
// Log: 2020-11-16 Created the file.
// 2020-11-16 Tested all values and Nich values also!
//
#define NOTE_Dot 523
#define NOTE_Dash 587
// input Buttoms Pin
const byte myPin2 =2;
const byte myPin3 =3;
// output Leds pin
const byte myPin10=10;
const byte myPin11=11;
// Buzzer
const byte myBuzzer =8;
// Parameter
int chosed = 0;
void setup() {
// input Pin
pinMode(myPin2,INPUT);
pinMode(myPin3,INPUT);
// output pin
pinMode(myPin10,OUTPUT);
pinMode(myPin11,OUTPUT);
pinMode(myBuzzer,OUTPUT);
// Computer output
Serial.begin(9600);
// Welcoming screen on Serial
Serial.println("Welcome to Morse Sender");
Serial.println(" ======================");
}
void loop() {
chosed = Which_Button();
switch (chosed)
{
case 0: //DOT
dot();
break;
case 1: // Dash
dash();
break;
}
}
void dot()
{
tone(myBuzzer, NOTE_Dot);
delay(100);
noTone(myBuzzer);
digitalWrite(myPin10, HIGH);
delay(250);
digitalWrite(myPin10, LOW);
delay(250);
}
void dash()
{
tone(myBuzzer, NOTE_Dash);
delay(200);
noTone(myBuzzer);
digitalWrite(myPin11, HIGH);
delay(250);
digitalWrite(myPin11, LOW);
delay(250);
}
int Which_Button(void)
{
int buttonState_Dot = 0;
int buttonState_Dash = 0;
Serial.println( "Dot or Dash ");
delay(200);
while (1){
buttonState_Dot = digitalRead(myPin2);
buttonState_Dash = digitalRead(myPin3);
if ( buttonState_Dot == HIGH)
{Serial.println("DOT") ;
return 0;}
else if (buttonState_Dash ==HIGH)
{Serial.println("DASH") ;
return 1;}
}
}
Learn More →
Thanks for Thomas Berggren for all knowledge and experience that looks clearly in backscenes of this project!
In all Factories we have machines or robots, these are the core of the factories, the more follow up for info from them , the better the performance. That's why in this platform prototype , I'm Going to collect data from these robot ( Temperature and Vibration) Using Simulation code into Adafruit Feather HUZZAH with ESP8266 this code send the Robot ID , Related Related Temperature and related Vibration( we can add as much as we can of Robots and we can change the type of info to add beside Temp and Vib like up time , errors, etc... ). These Info gonna send over TCP/IP Socket to a Raspberry Pi , or any PC running Python code attached into this tutorial. That will play the role of called it IoT Gateway, and that will save a cost and development time of this platform. Once Info sent to Raspberry Pi , for IoT Gateway , The Gateway will collect the info according to Algorithm that we like to program , in real time ,and send the result of this Alogarthem based on Periodical messages , that we can set also, to Azure IoT Hub , that we reffer to it into Python code and Related "CONNECTION_STRING". Onec the Message reach the IoT Hub , we creat a Listner for all these messages into out IoT Gateway so we validate the info has been sent.Actually we create Thread that take the messages ( Telementary) from cloud and print it into Console. Once the Message is into Azure IoT Hub , we route them to : 1- Blob Storage Using Message routing , 2- Table Storage using Azure Function APP 3- then download and process the data into remote computer.
Apr 7, 2021Auto-generated Table of Content [ToC] About Project: This project consist of 4 different Nodes. Once user Start Node 1 it dose a self test and connect to Wifi. and print info in UART log and on OLED Screen, Then Connect to MQTT Server, based on info in the code below. Then start to publish NoT Pressed until we Touch the Button ,that run interrupt to toggle the value of control Boolean parameter called (is_pressed)into our example. So the MCU will send by next loop a "Pressed" to Node 2 over Topic called "Button". and subscribe to Topic " Temp". Node 2, which is ESP32 DOIT ESP DEVKITV1, at that time ,
Jan 4, 2021UPDATED @2020-11-22: Added API to AakSensor and Visualise the data. Created By Ammar Alnahhas , ammar@dsna.se [ToC] Nothing better than controling these dummies via WI-FI :memo: How is it connected? Step 1: The componentes:
Jan 3, 2021[ToC] Let's Play this game against computer :video_game: With help of colored keys we can choose what we need to choose and then the computer choose radomly what to choose and pass the both to game engin that return the result as Player wins , CPU wins or Equal! :memo: How we build it? Step 1: The Hardware 1 unit Arduino UNO R3. 3 units Buttons.
Nov 28, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up