Skip to content

Instantly share code, notes, and snippets.

View hekras's full-sized avatar

Henryk Krasuski hekras

  • Software developer and more
  • Denmark
View GitHub Profile
@hekras
hekras / corona-virus-sweeper.html
Last active May 22, 2021 07:23
corona-virus-sweeper-2021
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Corona Virus Sweeper</title>
<style type="text/css">
* {
margin: 0;
border: 0;
@hekras
hekras / flock-of.html
Last active May 1, 2021 14:48
Flock of dots
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Flock of</title>
<style type="text/css">
* {
margin: 0;
border: 0;
<!DOCTYPE html>
<html>
<head>
<link rel="apple-touch-icon" sizes="57x57" href="../apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="../apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="../apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="../apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="../apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="../apple-icon-120x120.png">
// NeoPixel test program showing use of the WHITE channel for RGBW
// pixels only (won't look correct on regular RGB NeoPixel strips).
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1:
@hekras
hekras / square-invaders.bas
Last active July 3, 2021 08:39
invaders game ... weekend project
option explicit
mode 1,8
dim integer xpos=400, ypos=400 ' player positien
dim integer xmax, xmin ' invader x-bounds
dim float xoff=0, yoff=0, dx=1 'x-pos invaders
dim integer shooter = 0 ' spacebar shoot latch
dim integer q_action = 0 ' Q-key latch
dim integer missile_mode = 0, state = 0, state_counter
dim integer game_over = 0
@hekras
hekras / Realy-module-test.bas
Last active June 30, 2021 15:42
Testing the Colour Maximite 2 Exapansion bourd with the Relay module
SETPIN 31, DOUT 'set pin 31 to latch the chip
SPI OPEN 195315, 0, 16 'mode 0, data size is 16 bits
LED1 = &B01011
PIN(31) = 0
junk = SPI(LED1)
PIN(31) = 1
PAUSE(5000)
@hekras
hekras / Relay-and-LED-Shift-Register.bas
Created June 30, 2021 17:22
Testing 2 modules on the PS Labs CMM2 Expansion cards
SETPIN 31, DOUT 'set pin 31 to latch the relay card
SETPIN 33, DOUT 'set pin 33 to latch the shift register card
SPI OPEN 195315, 0, 16 'mode 0, data size is 16 bits
LED2 = 1
LED1 = 1
do
@hekras
hekras / cmm2-tones.bas
Created July 3, 2021 08:54
Colour Maximite 2 tones
dim tones(16)
for i=0 to bound(tones())-1
read tones(i)
next i
tempo=50
for i=0 to 20
a% = rnd * bound(tones())
play tone tones(a%), tones(a%), tempo
@hekras
hekras / square-invader-mouse.bas
Last active July 11, 2021 16:40
CMM2 Invaders with mouse support
option explicit
mode 1,8
dim integer xpos=400, ypos=400 ' player positien
dim integer xmax, xmin ' invader x-bounds
dim float xoff=0, yoff=0, dx=1 'x-pos invaders
dim integer shooter = 0 ' spacebar shoot latch
dim integer q_action = 0 ' Q-key latch
dim integer missile_mode = 0, state = 0, state_counter
dim integer game_over = 0
@hekras
hekras / tones-tracker.bas
Created July 31, 2021 17:40
CMM2 tones tracker
'==================================
'Tones tracker
'By Henryk K 2021.07.18
'==================================
option explicit
'dim tones(16)
dim string note.name$(97)
dim float note.freq(97)
dim integer note.oct%=4