Skip to content

Instantly share code, notes, and snippets.

View jozef's full-sized avatar
🐪
and the world keeps spinning around

Jozef Kutej jozef

🐪
and the world keeps spinning around
View GitHub Profile
@jozef
jozef / async-fetch.pl
Created September 29, 2021 08:17
Perl async example fetching pages open-graph information with concurrency of 2
#!/usr/env perl
use strict;
use warnings;
use 5.010;
binmode(STDOUT, ':encoding(UTF-8)');
binmode(STDERR, ':encoding(UTF-8)');
use Web::PageMeta;
use Future::Utils qw( fmap_void );
@jozef
jozef / sersh
Created October 5, 2020 20:46
sersh - serial port shell
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use AnyEvent;
use AnyEvent::SerialPort;
use AnyEvent::ReadLine::Gnu;
@jozef
jozef / ball.pl
Created December 22, 2018 18:01
add/collapse/explode bouncing balls
#!/usr/bin/env perl
=head1 NAME
balls.pl - add/collapse/explode bouncing balls
=head1 SYNOPSIS
./balls.pl
@jozef
jozef / bt_test.ino
Created November 5, 2017 22:29
test/demo for HC-06 Bluetooth module
/*
* test/demo for HC-06 Bluetooth module
*
* connect BT module TX to D10
* connect BT module RX to D11
* connect BT Vcc to 5V
* connect BT GND to GND
*
* to pair with computer -> name is HC-06 and pin is 1234
* connect via minicom to BT serial port:
@jozef
jozef / read_temp_sensor_address.ino
Last active October 21, 2017 16:30
read out temperature and address of DS18B20 sensors
#include <Wire.h>
#include <OneWire.h>
#include <LiquidCrystal_I2C.h>
#include <DallasTemperature.h>
// display vars
LiquidCrystal_I2C lcd(0x3f, 20, 4); // 20x4 display with I2C address 0x3f
// temperature vars
#define ONE_WIRE_BUS 8 // data one wire port 8
/*
SBT0811 + 42SH-32KCA stepper motor
will turn the motor 360° clockwise and then anti-clokwise
http://blog.kutej.net/2017/07/sbt0811_42sh32kca
Connect SBT0811 to Arduino:
IN1 -> D8
IN2 -> D9
IN3 -> D10
IN4 -> D11
/*
SBT0811 + 28BYJ-48 tepper motor
will turn the motor 360° clockwise and then anti-clokwise
https://www.youtube.com/watch?v=BBVmeim2uu8
Connect :
IN1 -> D8
IN2 -> D9
IN3 -> D10
IN4 -> D11
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
Servo myservo;
int servo_pos = 0;
LiquidCrystal_I2C lcd(0xbf, 16, 4);
int potenzio_pin = A0;
@jozef
jozef / HC_SR501.ino
Last active July 21, 2017 20:32
HC-SR501 PIR Motion with Arduino Pro Mini
// http://blog.kutej.net/2017/06/hc-sr501
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
byte onboard_led_pin = 13;
byte onboard_led_state = HIGH;
byte pir_motion_pin = 10;
byte pir_status = LOW;
#
# https://github.com/jozef/clock_micro/blob/0629cacf5e53c318ced5d43c9f608b8b6d38e637/clock_micro.ino
#
#include <Wire.h>
#include <OneWire.h>
#include <RTClib.h>
#include <LiquidCrystal_I2C.h>
#include <DallasTemperature.h>
#include "melody.h"