Normally asking for code doesn't give you any replies.
We usually don't do hand outs.
If you pay me, I might wright some code for you but you'll have to promise not to discolse it to anyone, there's also a £1000 set up fee and it'll cost to £5 per license which will only cover you for one device.
If you want to avoid paying for it then my adive is for you to have a go at doing it yourself and most people here will only be too happy to help you.
Well Gayan thanks for that link. Althou its not going to be a charge regulator just consumtion meter whit logging. Im using a shunt on the cords in and out from the batteries. This would be a great way to supplement the device if i get the time for it