Memory problems
Posted: Tue Aug 07, 2018 5:43 am
I have bought a small robot for micro:bit but have run into memory allocation issues. I have made a number of cut backs whilst developing this firstly my servo class , found at https://github.com/rhubarbdog/microbit-servo . It has been cut down to a single instance of ContinuousServo with no inheritance.
I want to add 4 integer parameters to my robot class, i currently have these values hard coded. These numbers are percentages in the range [-100,100]. If this were C and i had memory issues i'd declare these and other percentages as a `signed char` they'd only require a byte of storage.
Is there any way in MicroPython that i can force type to be a short integer or signed byte saving crucial memory allowing for further developments.
Any tips to store are retrieve 6 percentages ?
I want to add 4 integer parameters to my robot class, i currently have these values hard coded. These numbers are percentages in the range [-100,100]. If this were C and i had memory issues i'd declare these and other percentages as a `signed char` they'd only require a byte of storage.
Is there any way in MicroPython that i can force type to be a short integer or signed byte saving crucial memory allowing for further developments.
Any tips to store are retrieve 6 percentages ?