# Partition lists into sub-lists based on whether they are consecutive or not [duplicate]

I am new to Mathematica and would appreciate any help.

I'd like to partition my data which is comprised of {time x analog input} into sublists of consecutive time. In other words, my data looks like this:

{1, 3.567}, {2, 3.768}, {3, 4.214}, {15,3.986}, {16,3.785}, {28,2.998}, {29,3.678}, {30,3.216}, {31,4.012} etc.


And what I'd like is to be able to group them into:

{{1, 3.567}, {2, 3.768}, {3, 4.214}}, {{15,3.986}, {16,3.785}}, {{28,2.998}, {29,3.678}, {30,3.216}, {31,4.012}} etc.


How can I make a function where the sub-list varies depending on whether the first part of each data point, i.e. time, is directly after the other, and split it if the difference between the value and the value prior to it is greater than 1?

This

f[{t1_, a1_}, {t2_, a2_}] := t2-t1 ==1;
Split[{{1,3.567}, {2,3.768}, {3,4.214}, {15 3.986}, {16,3.785},
{28, 2.998}, {29, 3.678}, {30, 3.216}, {31, 4.012}}, f]


returns this

(* {{{1, 3.567}, {2, 3.768}, {3, 4.214}},
{{15, 3.986}, {16, 3.785}},
{{28, 2.998}, {29, 3.678}, {30, 3.216}, {31, 4.012}}} *)