Try it from the command line first, and once you get the syntax worked out there, move it into your code.

My apologies.. the 24-bit value is actually done with ASCII hex, as in:

echo "BUTTONRAW=0x123456" > /proc/empeg_notify
echo "BUTTONRAW=0x123456.R" > /proc/empeg_notify

I think. No empeg in front of me at the moment.