Better HN
topnewbestaskshowjobs
Log inSign up

bitbank

24 karma · joined Mar 15, 2016 (10y ago) · 82 submissions

Submissions

comment 1w ago · link · parent

On the ESP32 I was able to successfully send codes using the PWM feature with the frequency set to 38KHz. Here's that code:

// // IR transmit // Project started 10/12/2026 // written by Larry Bank // // Nano C6 IR LED on GPIO3 #define IR_LED 3 #define MARK 1 #define SPACE 0 // // Send pulse // void SendPulse(int iCount, int iType) { ledcWrite(IR_LED, (iType == MARK) ? 128 : 0); // 50% duty cycle when the signal is "on" delayMicroseconds(562 * iCount); // continue this mark or space for N 562.5us periods } /* SendPulse() / // // Transmit a 32-bit NEC IR code // void SendCode(uint32_t code) { SendPulse(12, MARK); // start Mark SendPulse(6, SPACE); // start space // 562 on, 562 off = logical 0 // 562 on, 1687 off = logical 1 for (int iBit=0; iBit < 32; iBit++) { SendPulse(1, MARK); // 562.5us mark SendPulse((code & 0x80000000) ? 1 : 3, SPACE); // 562.5 or 1687.5us space for 1 or 0 code <<= 1; } SendPulse(1, MARK); // end of code SendPulse(1, SPACE); // turn off the LED } / SendCode() */

void setup() { pinMode(IR_LED, OUTPUT); ledcAttach(IR_LED, 38000, 8); ledcWrite(IR_LED, 0); // start with it off

  while (1) {
    SendCode(0xc03fe01f);
    delay(1000);
  }
}

void loop() { }

comment 2w ago · link · parent

I updated my blog post with some corrections and inclusion of new info provided by Espressif

comment 2w ago · link · parent

A blog post with details and working code to give you a 'learning remote' (aka any spare remote control you have lying around). It allows you to control any media playback on your Mac or PC from the comfort of your sofa.

comment 2w ago · link · parent

A blog post about my desire to restore IR remote control to media playback on the MacBook and how it led me to re-invent the wheel and create the smallest amount of code to decode NEC 32-bit IR codes.

5.

Fast GPIO on Linux(bitbanksoftware.blogspot.com ↗)

3 points · by bitbank · 1mo ago · discuss

comment 1mo ago · link · parent

I was testing some sensors on various Linux SBCs and kept having to use i2cdetect. Each time I ran it, I thought that there had to be a friendlier way to get this information...

7.

A Friendlier Version of I2cdetect(github.com ↗)

2 points · by bitbank · 1mo ago · 1 comment

comment 7mo ago · link · parent

A blog post showing you how to transition your SIMD code from the ESP32-S3 to the ESP32-P4 (even though Espressif hasn't released the documentation yet)

9.

ESP32-P4 SIMD Explained(bitbanksoftware.blogspot.com ↗)

5 points · by bitbank · 7mo ago · 1 comment

comment 1y ago · link · parent

I just shared a blog post (with Arduino code) for an ESP32 IP camera viewer. The frame rate isn't amazing, but it works. The main limitation holding back the performance is the ESP32's HTTPClient library.

comment 1y ago · link · parent

This is a short video of my FastEPD library running on the M5Stack PaperS3. LVGL version 9 is set to 8-bit grayscale mode and I'm converting that to 1-bit graphics to allow fast partial updates of the eink panel. I will be publishing this and more LVGL demos at https://github.com/bitbank2/bb_lvgl

comment 1y ago · link · parent

This is a project I've thought about for a while - it allows you to work on your Arduino project in Xcode. This dramatically increases productively and reduces frustration.

comment 1y ago · link · parent

The pl_mpeg project is a single .H file MPEG-1 player (video+audio) written in generic C. It wasn't written for speed, but to be a simple working project that can be compiled on any system. I decided to use my experience with code optimization to bring it to 32-bit MCUs. My changes so far have sped it up about 230% (on my Mac M1). The ESP32 and Cortex-M7 are the natural targets because they have enough speed and memory (with PSRAM) to run decent sized videos. MPEG-1 isn't the best video codec, but it's patent-free and simple enough to do in a few thousand lines of C code. It requires a lot more RAM compared to a Motion-JPEG player, but the compressed data is 5 to 10 times smaller and the per-frame effort is much lower. I will publish an Arduino example shortly which will play full speed video+audio on an inexpensive ESP32-S3 PCB.

comment 1y ago · link · parent

My latest blog post about my efforts to write my own parallel ink library from a blank slate.

comment 1y ago · link · parent

I'm working on a new library to drive parallel e-ink displays (think Kindle). The EPDiy library has done this for the last few years, but it's missing some important features that I wanted to have. My new code is simpler, more efficient, more flexible and includes advanced features such as compressed fonts and graphics, no external dependencies and support for more hardware. More info soon...

comment 2y ago · link · parent

I optimize software for a living. It's a hard sell because there's usually resistance to allow me (an outsider) to help with someone else's software. The video of the epaper animation is a good example of how I can help - the code shipped with that product allows for partial updates at 226ms. My code changes got it down to 92ms for that GIF animation (no hardware was harmed). Many products are born from generic library code and data sheet examples without careful consideration to the time it takes the CPU to do certain jobs. It's always an uphill battle to get companies to allow me to help them, but the customers benefit when they do. I'm working on sharing this code and more like it, but I need some support from the community. I share a lot of projects with the community (https://github.com/bitbank2), but need more support to keep doing it.

comment 2y ago · link · parent

A short blog post on my new e-paper library which supports a lot of functionality from very constrained environments.

comment 2y ago · link · parent

A brief writeup about my idea for a very effective way to losslessly compress bitmap font data for use on microcontrollers.
123