Skip to content

Instantly share code, notes, and snippets.

View Anas-jaf's full-sized avatar
🎯
Focusing

Anas Mahmoud Anas-jaf

🎯
Focusing
View GitHub Profile
#define SENSOR_COUNT 8
// Analog + Digital pins مع بعض
const uint8_t sensorPins[SENSOR_COUNT] = {
A0, A1, A2, A3, A4, A5, 2, 3
};
uint16_t sensorValues[SENSOR_COUNT];
const uint16_t TIMEOUT_US = 3000;
// QTR-RC 8 sensors through CD74HC4067
// Using channels C1 to C8
// Arduino -> MUX
// D2 --> S0
// D3 --> S1
// D4 --> S2
// D5 --> S3
// A0 --> SIG
#define SENSOR_COUNT 8
// ===== MUX Select Pins (Digital) =====
const int S0 = 2; // Low bit (1)
const int S1 = 3; // (2)
const int S2 = 4; // (4)
const int S3 = 5; // High bit (8) - Keep LOW for 0-7
// ===== MUX Signal Pin (Analog) =====
const int MUX_SIG = A0; // Connect MUX "COM" or "SIG" to Nano A0
int sensorValues[8]; // Array for all 8 channels
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "RTClib.h"
// 1. Initialize the LCD (Address 0x27 is standard, 16 columns, 2 rows)
// If your screen is blank, change 0x27 to 0x3F
LiquidCrystal_I2C lcd(0x27, 16, 2);
// 2. Initialize the RTC module
RTC_DS3231 rtc;
class RandomNumberGenerator:
"""A class for generating random numbers with a specified sum and individual ranges.
Example Usage:
```python
total_sum = 18
numbers = [3, 2, 4, 5, 1, 3]
ranges = RandomNumberGenerator.convert_to_ranges(numbers) # ranges = [(0, 3), (0, 3), (0, 5), (0, 5), (0, 2), (0, 2)]
generator = RandomNumberGenerator(total_sum, ranges)
arr = document.querySelectorAll("a[jsname='UWckNb']")
// e[0].href
arr[0].href
for (let element of arr) {
console.log(element.href); // Logs the href of each element
}
import pandas as pd
import mysql.connector
# Replace 'your_file.xlsx' with the path to your Excel file
file_path = '07_محافظة_الكرك.xlsx'
df = pd.read_excel(file_path, skiprows=9)
data_dict = df.to_dict(orient='records')
db = mysql.connector.connect(
<!DOCTYPE html>
<html lang="ar" dir="rtl" class="rtl">
<head>
<meta charset="utf-8" />
<title>نظام إدارة المعلومات التربوية الاردن</title>
<link href="/openemis-core/favicon.ico" type="image/x-icon" rel="icon" />
<link
href="/openemis-core/favicon.ico"
type="image/x-icon"
/*
JSN-SR04T-V3.0 Ultrasonic Sensor - Mode 0 Demo
srt04-mode0.ino
Uses JSN-SR04T-V3.0 Ultrasonic Sensor
Displays on Serial Monitor
Mode 0 is default mode with no jumpers or resistors (emulates HC-SR04)
DroneBot Workshop 2021
https://dronebotworkshop.com