Lib for Gobeur action

Dependents:  

Committer:
mondiaye
Date:
Mon Jul 05 19:50:05 2021 +0000
Revision:
2:853546cbc5fe
Parent:
1:f18f5b34eece
logs added and loops fixed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mondiaye 0:7312173b8d5f 1
mondiaye 0:7312173b8d5f 2 // ----- Variables -------
mondiaye 0:7312173b8d5f 3 #define GOBEUR_RIGHT 0
mondiaye 0:7312173b8d5f 4 #define GOBEUR_LEFT 1
mondiaye 0:7312173b8d5f 5
mondiaye 0:7312173b8d5f 6 // ~ PIN ~
mondiaye 1:f18f5b34eece 7 PinName servo_aspire_1_pin = PA_9 ; // ? Right
mondiaye 1:f18f5b34eece 8 PinName servo_aspire_2_pin = PB_6 ; // ? Left
mondiaye 1:f18f5b34eece 9 PinName servo_block_1_pin = PA_15 ; // ? Right
mondiaye 1:f18f5b34eece 10 PinName servo_block_2_pin = PB_7 ; // ? Left
mondiaye 0:7312173b8d5f 11
mondiaye 0:7312173b8d5f 12 // ~ Status ~
mondiaye 0:7312173b8d5f 13 int gobeur_right_status = -1 ; // 1 : blocked 0 : opened
mondiaye 0:7312173b8d5f 14 int gobeur_left_status = -1 ; // 1 : blocked 0 : opened
mondiaye 0:7312173b8d5f 15
mondiaye 0:7312173b8d5f 16 int gobeur_right_aspire = -1 ; // 1 : suck 0 : do nothing
mondiaye 0:7312173b8d5f 17 int gobeur_left_aspire = -1 ; // 1 : suck 0 : do nothing
mondiaye 0:7312173b8d5f 18
mondiaye 0:7312173b8d5f 19 int init_status = -1 ; // 1 : initalize
mondiaye 0:7312173b8d5f 20
mondiaye 0:7312173b8d5f 21 int game_status = -1 ; // 1 : in game 0 : end game
mondiaye 0:7312173b8d5f 22
mondiaye 0:7312173b8d5f 23
mondiaye 0:7312173b8d5f 24 // ------ Functions ---------
mondiaye 0:7312173b8d5f 25 void gobeur_initialize() ;
mondiaye 0:7312173b8d5f 26 int aspirateur_on(uint8_t gobeur_id) ;
mondiaye 0:7312173b8d5f 27 int aspirateur_off(uint8_t gobeur_id) ;
mondiaye 0:7312173b8d5f 28 int block_gobelet(uint8_t gobeur_id) ;
mondiaye 0:7312173b8d5f 29 int unblock_gobelet(uint8_t gobeur_id) ;
mondiaye 2:853546cbc5fe 30 void gobeur_action(const gobeur_node::Gobeur& gobeur_msg);
mondiaye 0:7312173b8d5f 31