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
option explicit
open "COM2:9600" AS #2
controller nunchuk open
mode 1, 8
dim current_turnout=0
dim nunchuk_trigger
dim oldk$ = ""
dim d,n,m,x,y,p,t,bordercolor,jx,jy,ca,cb
dim a$, k$
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#ifndef PSTR
#define PSTR // Make Arduino Due happy
#endif
// NeoMatrix pin
#define PIN 7
#include <ESP8266WiFi.h>
#include <espnow.h>
// Structure example to receive data
// Must match the sender structure
typedef struct struct_message {
int a0;
int a1;
int a2;
int a3;
@hekras
hekras / esp-now-sender.c
Last active September 18, 2022 10:21
Code for remotecontrol
#include <ESP8266WiFi.h>
#include <espnow.h>
int a0 = 5;
int a1 = 4;
int a2 = 0;
int a3 = 2;
int a4 = 10;
int a5 = 13;
@hekras
hekras / Blink-Motor-2.c
Last active September 4, 2022 14:51
Test af ESP8266 interface til 2x motor via L293
@hekras
hekras / js.js
Last active March 8, 2022 19:31
Sinus mesh effect
/**
*
* @author Henryk Krasuski
* @date 2022-03-07
*
*/
// ===================================================
// Animate interrupt
@hekras
hekras / comet-demo.bas
Last active December 19, 2021 08:27
CMM2-Love: comet-demo.bas
' comet
option explicit
dim float sssx(1000)
dim float sssy(1000)
const stars=200
const sss.x=0
const sss.y=1
const sss.dx=2
const sss.dy=3
const sss.count=4
@hekras
hekras / poly-into.bas
Created November 29, 2021 18:15
A rotating star for CMM2
' draws triangle with polygon
const dots=13
dim xp(dots)
dim yp(dots)
radius=250
start_angle=0
dangle=0.005
@hekras
hekras / cmm2-virusswweper-2021.bas
Created October 23, 2021 17:37
Virus sweeper for CMM2 BASIC
'==================================
'Virus sweeper
'By Henryk K 2021.10.19
'==================================
option explicit
const grid.xmax = 51
const grid.ymax = 37
dim integer grid.squares
const gg.bomb = 0 ' is there a bomb i the square
const gg.checked = 1 ' has the square been checked