Fixed memory issues, added example GPIO sensor code.