In core code I have a tuple containing two values (155, 110)
I used
mp_obj_tuple_get(current_point, &tuple_len, &tuple_items);
to get the items from the tuple and I can successfully print them like:
mp_printf(&mp_plat_print, "%d\n", mp_obj_get_int(tuple_items[0]));
I can also successfully do some math operation on the value and print the result:
mp_printf(&mp_plat_print, "%d\n", mp_obj_get_int(tuple_items[0])+1);
These print 155 and 156 respectively.
I am trying to figure out how to make a new tuple containing result of the math operation, so I'd like to end up with a tuple that has (156, 110) but I'm not understanding how. When I try to create the new tuple with these values I end up with TypeError: can't convert float to int printed even though the math from the prints above is working properly and the way I'm creating the new tuple is the same as the way the original one was created as far as I can tell. I can share more of the code used for this attempted creation if it would be helpful.
Anyone have a hint or point in the right direction on how I can access a value from a tuple, manipulate it (add or subtract 1) and then make a new tuple containing the result and the other value from the original tuple.