Gareth's blog

ESP32 - Pushing a Varaible out to multiple GPIO pins using registers

Gareth's picture

How to output a variable directly to GPIO pins ... i.e. in parallel.

This can be done using the ESP32's registers.

// sending a variable to GPIO pins Bitwise register style

// create a parallel GPIO bus using GPIO 12,13,14,15 i.e. must be consecutive pins
#define PARALLEL_0  12

int RGBled=000; // demo RGB connected to Gpio pin 12,13,14,15

void setup() {

ESP32 - Setting up 2 cores to run 2 parallel Code threads

Gareth's picture

Here is the simplest way to get code running parallel with two separate cores on the ESP32.

Web Time Syncing for your web enabled mcu projects.

Gareth's picture

My latest ESP32/Nextion touch screen Weather/bus/train times project required a realtime clock.... however it has taken me quite a few weeks to find a good solid solution.
Firstly :-
....if you want to stay sane then avoid epoch time (best thing that happened in 1970's was "punk Rock" not unix count my seconds since birth)....rant over.

TOF gets a local DEBUG screen

Gareth's picture


Up till now I have been porting scans over the Serial wires and manually presenting the data.....

Now the Rig has its own Real-Time Debug TFT Display. (you might see it below the right wheel)

Above is just a 180° scan of this below :-

Wooden planks set at 90° and two DVD cases thrown in for measure.

Time of Flight >>> Rounded Corners !!!

Gareth's picture

I placed the Sensor rig into a cardboard box just to get a feeling for the data.

This is two passes of the probe, so you can see the slight variance in data.

Overlaying the raw data for 180°.... this was with GIMP so its just approximate

all looks kinda good except Hmmmm.... rounded corners cannot be explained...

another scan with DVD's :-

Point cloud anyone !!! maybe 3D scanner

Gareth's picture

Its scanning, the stealthy Dual Time of Flight wiring was a soldering pig to execute (or should I say "Exterminate").

Data is flowing.... at momo a bit strange 200 Steps = 360° (until microstep instigated giving theoretical 1/16 steps ermm if my maths is correct 3200 Steps for 360° however at the price of speed)

Double_ing up the "Time of Flight" sensors

Gareth's picture

Two is better than one...... (or 4 or 8 etcetcetc).

Following successful experiments with 1 single Time of Flight distance sensor mounted to Stepper, watching the scan process its seems to lend its self to setting the scan to just 180° and mount two sensors back to back to extract the whole 360°...... (or 90° scan with 4 sensors, hope you see where I am going with this :-)

BlueTooth elves choose "BlueTeeth"

Gareth's picture

Time of Flight meets BlueTooth.....

Extensive testing with WiFi mesh networks proved to be not the way to go for this project... timing issues killed the progress.

Exit Wifi Mesh network goblins...... YAY

Enter the BlueTeethed Elves ....... YAY

The ESP32 has up its sleeve BlueTooth capabilities, it was a simple job to reconvert the data packets.

It all gets a bit Meshy

Gareth's picture

Persistance pays off , ESP8266 Mesh network begins to work, this transmits sensor data from the Time of Flight Laser distancing module and the Compass module to the basestation rover.

The latest Plan (software Workio) :-

1.ProMini + TOF + Compass +ESP8266 sits on top of the 360° rotating Stepper motor (can be any speed literally (just limited up to the max that the TOF and compass can read data))

Mesh Networking the LIDAR elements together ESP8266 <> ESP32

Gareth's picture

One step further in attempt to make a wireless system between the base rover station and the spinning Laser module.


In a Nutshell :-