Difference between revisions of "CRITR/Arm Control gen2"

From Lofaro Lab Wiki
Jump to: navigation, search
(Created page with "Notes : *Micro-controller, Pro-mini, is used for the second generation arm controller. *Each Pro-mini has 8 analog pin, therefore 3 Pro-mini is used. Micro-controller_1 * Tx...")
 
Line 8: Line 8:
 
  char str[16];
 
  char str[16];
 
  char Base_36_Table[36] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};  
 
  char Base_36_Table[36] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};  
 
 
  void setup() {
 
  void setup() {
 
     Serial.begin(250000);
 
     Serial.begin(250000);
 
     delay(100);
 
     delay(100);
 
  }  
 
  }  
 
 
  void loop() {
 
  void loop() {
 
   int i=0;
 
   int i=0;

Revision as of 17:45, 8 December 2015

Notes :

  • Micro-controller, Pro-mini, is used for the second generation arm controller.
  • Each Pro-mini has 8 analog pin, therefore 3 Pro-mini is used.

Micro-controller_1

  • Tx of Micro_controller_1 connects to Rx of Micro-controller_2
int pos[8];
char str[16];
char Base_36_Table[36] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; 
void setup() {
    Serial.begin(250000);
    delay(100);
} 
void loop() {
  int i=0;
  int id = 0;
  for (int i=0; i<8; i++){
    pos[i] = analogRead(i);
    str[id++] = Base_36_Table[pos[i]/36];
    str[id++] = Base_36_Table[pos[i]%36];
  }
  for(int i=0; i<16; i++){
    Serial.write(str[i]);
  }
  Serial.println("");
  delay(80);
}

Micro-controller_2

  • Rx of Micro_controller_2 connects to Tx of Micro-controller_1
  • Tx of Micro_controller_2 connects to Rx of Micro-controller_3


Micro-controller_3 (This connects to field computer)

  • Rx of Micro_controller_3 connects to Tx of Micro-controller_2