This Arduino sketch implements a SUMP protocol compatible logic analyzer for the Arduino board supports up to 6 channels consisting of digital pins 8-13. On the Arduino Mega board 8 channels are supported and 7k of samples. Pins 22-29 (Port A) are used on a Mega.
Cool! It is easy to use, just load the sketch and fire up the OLS client. Once you select the correct device and serial port, it should just work. If you have trouble there is a thread on the Arduino forums you can check out. You might want to add some parts like a current limiting resistor or protection diode on the sampling pins.
i made something similar! https://www.hackster.io/vincenzo-gibiino/diy-logic-analyzer-f61ee5?ref=user&ref_id=90293&offset=0