Skip to content

Instantly share code, notes, and snippets.

#define FASTLED_SHOW_CORE
static TaskHandle_t FastLEDshowTaskHandle = 0;
static TaskHandle_t userTaskHandle = 0;
void FastLEDshowESP32()
{
if (userTaskHandle == 0) {
const TickType_t xMaxBlockTime = pdMS_TO_TICKS( 200 );
// -- Store the handle of the current task, so that the show task can
@hpwit
hpwit / fastledsecondcorenowait
Last active May 11, 2018 17:41
FastLed on second core but with handing back the hand to the main loop
#define FASTLED_SHOW_CORE 0
static TaskHandle_t FastLEDshowTaskHandle2 = 0;
static TaskHandle_t userTaskHandle = 0;
void FastLEDshowESP322()
{
if (userTaskHandle == 0) {
const TickType_t xMaxBlockTime = pdMS_TO_TICKS( 200 );
// -- Store the handle of the current task, so that the show task can
@hpwit
hpwit / turnpicaround
Created May 13, 2018 09:12
turn a picture around
//this is may pacman
int pacmab[256]={
9,9,9,9,9,9,9,9,
9,1,1,1,9,9,9,9,
1,1,1,1,1,9,9,9,
1,1,1,1,1,9,9,9,
1,1,1,1,1,9,9,9,
9,1,1,1,9,9,9,9,
9,9,9,9,9,9,9,9,
@hpwit
hpwit / transpose.c
Created July 27, 2018 12:06
transformation 24*1 and 32*1
void transpose24x1_noinline(unsigned char *A, uint32_t *B) {
uint32_t x, y, x1,y1,t,x2,y2;
// Load the array and pack it into x and y.
/* y = (*(unsigned char*)(A) & 0xffff ) | ((*(unsigned char*)(A+4) & 0xffffL )<<16) ;
x = (*(unsigned char*)(A+8)& 0xffff ) | ((*(unsigned char*)(A+12) & 0xffffL )<<16) ;
y1 = (*(unsigned char*)(A+2)& 0xffff ) | ((*(unsigned char*)(A+6) & 0xffffL )<<16);
x1 = (*(unsigned char*)(A+10)& 0xffff )| ((*(unsigned char*)(A+14) & 0xffffL )<<16);*/
//printf("%d\n",*(unsigned int*)(A+4));
@hpwit
hpwit / clockless_block_esp32.h
Created August 4, 2018 08:46
new version of the clock_block_esp32.h
#ifndef __INC_CLOCKLESS_BLOCK_ESP8266_H
#define __INC_CLOCKLESS_BLOCK_ESP8266_H
#define FASTLED_HAS_BLOCKLESS 1
#define PORT_MASK4 (((1<<USED_LANES_FIRST)-1) & 0x0000FFFFL) //on dit que l'ion va en faire 10
#define FIX_BITS(bits) ( ((bits & 0xE0L) << 17) | ((bits & 0x1FL)<<2) )
#define FIX_BITS2(bits) ( ((bits & 0xFF00L)<<4) | ((bits & 0xE0L) << 15) | ((bits & 0x1EL)<<1) | (bits & 0x1L) )
#define PORT_MASK3 (((1<<USED_LANES_SECOND )-1) & 0x0000FFFFL)
#define PORT_MASK2 FIX_BITS(PORT_MASK3)
@hpwit
hpwit / esp32 20180805.c
Created August 5, 2018 07:44
Revert to an old version of the esp32Block
#ifndef __INC_CLOCKLESS_BLOCK_ESP8266_H
#define __INC_CLOCKLESS_BLOCK_ESP8266_H
#define FASTLED_HAS_BLOCKLESS 1
#define PORT_MASK4 (((1<<USED_LANES_FIRST)-1) & 0x0000FFFFL) //on dit que l'ion va en faire 10
#define FIX_BITS(bits) ( ((bits & 0xE0L) << 17) | ((bits & 0x1FL)<<2) )
#define FIX_BITS2(bits) ( ((bits & 0xFF00L)<<4) | ((bits & 0xE0L) << 15) | ((bits & 0x1EL)<<1) | (bits & 0x1L) )
#define PORT_MASK3 (((1<<USED_LANES_SECOND )-1) & 0x0000FFFFL)
#define PORT_MASK2 FIX_BITS(PORT_MASK3)
@hpwit
hpwit / readjinxfromSD.ino
Last active August 10, 2018 12:28
read the content of a saved file Artnet
#include <WiFi.h>
//#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <Artnet.h>
/*
* Connect the SD card to the following pins:
*
* SD Card | ESP32
@hpwit
hpwit / saveframes2.ino
Last active August 10, 2018 20:08
Saveframe from artnet stream
#include <WiFi.h>
//#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <Artnet.h>
/*
* Connect the SD card to the following pins:
*
* SD Card | ESP32
#include <WiFi.h>
//#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <Artnet.h>
//#define FASTLED_ALLOW_INTERRUPTS 0
//#define INTERRUPT_THRESHOLD 1
#include "FastLED.h"
FASTLED_USING_NAMESPACE
/*
* Connect the SD card to the following pins:
*
* SD Card | ESP32
* D2 -
* D3 SS
* CMD MOSI
* VSS GND
* VDD 3.3V
* CLK SCK