That absolutely works. The L4CX collects the raw histogram data and sends it to your MCU where the answer is calculated. But the L4CD uses an algo we call 'standard ranging' or 'Sigma Delta'. The answer is calculated on chip and one can use it and thresholds to create selective interrupts.
But the L4CX is a superset of the L4CD.
There is absolutely no problem using the L4CD code on the L4CX. It will work just fine.
Running the more complex L4CX code on a L4CD is however not recommended. It will work - sort of. But if you go into production like that you will have issues. It's fine for a short test, but not for the production.
-john
If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.