Skip to content

Instantly share code, notes, and snippets.

View upsilun's full-sized avatar
🛰️
Beep.. Booooop!

Yazeed Alahmad upsilun

🛰️
Beep.. Booooop!
View GitHub Profile
#include <iostream>
#include <windows.h>
void sendSerialData(const wchar_t* portName, const char* data) {
HANDLE hSerial;
DCB dcbSerialParams = { 0 };
COMMTIMEOUTS timeouts = { 0 };
// Open the serial port
hSerial = CreateFileW(portName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@upsilun
upsilun / update_weather.bat
Created April 26, 2024 21:34
Error (HTTP/1.1 301 Moved Permanently. WXTOIMG problem, Error: Error (HTTP/1.1 301 Moved permanently) getting weather.txt from www.celestrak.com.
curl -o weather.txt https://celestrak.org/NORAD/elements/weather.txt
@upsilun
upsilun / bank.c
Created November 23, 2023 20:41
An Bank application made for my project in C Programming in KKU
/*
Fully Devolped by Yazeed Alahmad and Mohmammad Alasmari
*/
// These are the libraries that used in this project
#include <stdlib.h>
#include <string.h>
// These libraries are only for some text formatting purposes
#include <stdio.h>
#include <windows.h>
@upsilun
upsilun / ansi.cpp
Last active October 9, 2024 09:53
🎨 ANSI Codes for text formatting.
"\033[0m" // Reset all text attributes to default
"\033[1m" // Bold on
"\033[2m" // Faint off
"\033[3m" // Italic on
"\033[4m" // Underline on
"\033[5m" // Slow blink on
"\033[6m" // Rapid blink on
"\033[7m" // Reverse video on
"\033[8m" // Conceal on
"\033[9m" // Crossed-out on
@upsilun
upsilun / main.cpp
Created April 10, 2023 23:54
Getting pressed keyboard key in ASCII code
#include <iostream>
#include <conio.h>
using namespace std;
int main() {
char ch;
while(true) {
if(_kbhit()) { // check if key has been pressed
ch = _getch();
const int BUTTON_PIN = 7; // Arduino pin connected to button's pin
const int BUZZER_PIN = 3; // Arduino pin connected to Buzzer's pin
void setup() {
Serial.begin(9600); // initialize serial
pinMode(BUTTON_PIN, INPUT_PULLUP); // set arduino pin to input pull-up mode
pinMode(BUZZER_PIN, OUTPUT); // set arduino pin to output mode
}
void loop() {
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
while (!Serial);
Serial.println("Input 1 to Turn LED on and 2 to off");
}
void loop() {
@upsilun
upsilun / index.html
Created December 23, 2021 09:09
OpenCV.js Video Processing
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<body>
<div id="container">
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td></td>
<td>
<div class="text-center">
<span>Current Filter: </span><span id="filterName">Pass Through</span>
</div>