Arduino code fix for M5Stick C plus, RoverC Pro and JoyC operation

Job ID: 33472990

Budget: £10 – £20 GBP

Hi there. I seeking some simple Ardunio code to enable operation of the following M5Stck hardware:
M5Stick C plus, RoverC Pro hat and the JoyC hat.
Product details for the above can be found at the following web links:
https://shop.m5stack.com/collections/m5-controllers/products/m5stickc-plus-esp32-pico-mini-iot-development-kit
https://shop.m5stack.com/products/joyc-w-o-m5stickc?_pos=1&_sid=304ae7ac3&_ss=r
https://shop.m5stack.com/products/roverc-prow-o-m5stickc

The RoverC pro hat is supplied with a simple servo operated gripper/claw. Sadly M5 have not made any code available to operate the gripper (also sold separately as "catch unit") - see below link.
https://shop.m5stack.com/products/catch-unit?_pos=1&_sid=2962eb22c&_ss=r

I have found the following project example & code but there appears to be an error when compiling:
Project example:
https://twinklesmile-blog42-fc2-com.translate.goog/blog-entry-433.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp&_x_tr_sch=http

Code example:
https://github-com.translate.goog/komix-DIYer/M5Stack/blob/master/M5StickCPlus_RoverCPro_withGripper/M5StickCPlus_RoverCPro_withGripper.ino?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp#L156-L212

Please can you provide working code to allow operation of the RoverC claw via the JoyC using the M5StickC plus. Unlike the example code (which I could not get to work), ideally I would like to be able to operate the servo claw using the right hand joystick push button whilst also driving. I hope you can help. Many thanks Will
Related categories: Arduino