Skip to content

Instantly share code, notes, and snippets.

@idreamsi
idreamsi / divar_notifier.py
Created May 10, 2025 11:52 — forked from mthri/divar_notifier.py
Divar to Telegram Notifier Bot
"""
Divar to Telegram Notifier Bot
This script monitors a filtered Divar page and sends newly posted items to a specified Telegram channel every 60 seconds.
Setup Instructions:
1. Create a Telegram bot using BotFather.
2. Add the bot to your Telegram group or channel.
3. Promote the bot as an admin in your channel so it can post messages.
4. Use @username_to_id_bot to get the numeric ID of your channel (e.g., -1001234567890).
#!/usr/bin/python3
import notecard
from notecard import hub
from periphery import I2C
import cv2
import keys
import time
from picamera2 import Picamera2
from smbus2 import SMBus
from bme280 import BME280
#include <wiringPi.h>
int main(void)
{
int time = 100;
wiringPiSetup();
pinMode(7, OUTPUT);
pinMode(0, OUTPUT);
pinMode(2, OUTPUT);
for(;;)
{
@idreamsi
idreamsi / test.ino
Last active September 3, 2019 16:30
UTF-8 test with u8g2
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
@idreamsi
idreamsi / ESP8266-SoftAP-WebServer.ino
Created February 7, 2019 07:46
ESP8266 example: Wi-Fi Access point, static IP, web-server and remote GPIO control
/* Create a WiFi access point and provide a web server on it. */
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
IPAddress apIP(42, 42, 42, 42); // Defining a static IP address: local & gateway
// Default IP in AP mode is 192.168.4.1
/* This are the WiFi access point settings. Update them to your likin */
const char *ssid = "ESP8266";
@idreamsi
idreamsi / eeprom_rw_test.ino
Created December 1, 2018 16:25 — forked from t3db0t/eeprom_rw_test.ino
Arduino EEPROM Read-Write Example
/******************************************************
Arduino EEPROM Read-Write Test
by Ted Hayes 2012
[email protected]
Demonstrates the usage of the EEPROM Library for checking the state of a single value,
changing it, and resetting it. To use:
1) Put a momentary switch between ground and pin 11 on your Arduino.
@idreamsi
idreamsi / BasicHttpClient.ino
Last active May 20, 2018 17:15
Control ESP8266 Builtin LED via HTTP
//Control ESP8266 Builtin LED via HTTP
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#define USE_SERIAL Serial
ESP8266WiFiMulti WiFiMulti;
@idreamsi
idreamsi / image_matrix.py
Created May 20, 2018 14:54 — forked from vgmoose/image_matrix.py
Creates a C array from a bitmap file
import json
import sys
import os
print ".--=============--------------=============--."
print "| Welcome to Image Matrix Maker! |"
print ".--=============--------------=============--."
yeswords = ["yes", "y", "ya", "ok", "okay"]
#include <SPI.h>
const int slaveSelectPin = D8;
uint8_t buffer[16][16][3] = { 0 };
unsigned long step = 0;
//------------------demos------------------------
void gradient(uint8_t x, uint8_t y, unsigned long step) {
@idreamsi
idreamsi / LCD_Game.ino
Created January 15, 2017 16:43 — forked from dadecoza/LCD_Game.ino
Side scrolling one button jump game for the Arduino LCD Keypad shield.
/* Modified slightly to work with the LCD Keypad Shield.
* Original - http://www.instructables.com/id/Arduino-LCD-Game/
*/
#include <LiquidCrystal.h>
#define SPRITE_RUN1 1
#define SPRITE_RUN2 2
#define SPRITE_JUMP 3
#define SPRITE_JUMP_UPPER '.' // Use the '.' character for the head
#define SPRITE_JUMP_LOWER 4