 {
   byte pin = bctoi(2, 1);
   if (pin < 0 || pin > 7) { err(); return; }
-  unsigned long a;
-  a = (unsigned long) analogRead(pin);
-  a = a * 5000 / 1024;
+  unsigned long a = (unsigned long)analogRead(pin) * 625 >> 7;
   Serial.print("RA");
-  Serial.print((unsigned int) pin);
+  Serial.print((unsigned int)pin);
   Serial.print("=");
   Serial.println(a);
 }

byte motor2_target = MOTOR_VELOCITY_0;
byte motor_velocity = 30;
byte motor_velocity_increment = 5;
unsigned int motor_counter_start = 3000;
unsigned int motor_counter = 0;

//=======================================

void setup() 
{
  // setup pins to lower power consumption
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, LOW);
  pinMode(2, INPUT_PULLUP);


#define LED_PIN 13

// host communication //
#define MAX_COMMAND 10
#define BUF_SIZE 32
byte buf[BUF_SIZE];
