Revision cd87454c
| firmware/demo/QuadDRV-HwTest/QuadDRV-HwTest.ino | ||
|---|---|---|
| 16 | 16 | 
     | 
| 17 | 17 | 
    uint8_t library = 6; // LRA  | 
| 18 | 18 | 
    char motor = '!'; // '!' = disabled  | 
| 19 | 
    bool debug = false;
   | 
|
| 19 | 
    bool debug = true;
   | 
|
| 20 | 20 | 
     | 
| 21 | 21 | 
    void setup() {
   | 
| 22 | 22 | 
    Wire.begin();  | 
| 23 | 23 | 
     | 
| 24 | 24 | 
    // wait for serial port to connect  | 
| 25 | 
    while (!Serial);  | 
|
| 25 | 
    //  while (!Serial); 
   | 
|
| 26 | 26 | 
    Serial.begin(9600);  | 
| 27 | 27 | 
    delay(250);  | 
| 28 | 28 | 
     | 
| ... | ... | |
| 35 | 35 | 
    }  | 
| 36 | 36 | 
     | 
| 37 | 37 | 
    void loop() {
   | 
| 38 | 
    //  Serial.println("Test loop");
   | 
|
| 38 | 39 | 
      if (Serial.available()) {
   | 
| 39 | 40 | 
     | 
| 40 | 41 | 
    char cmd = Serial.read();  | 
| ... | ... | |
| 51 | 52 | 
              Serial.print("playing on channel ");
   | 
| 52 | 53 | 
    Serial.println(cmd);  | 
| 53 | 54 | 
    }  | 
| 54 | 
          case ('0'):
   | 
|
| 55 | 55 | 
     | 
| 56 | 
    // single motor: play 'rare' case  | 
|
| 57 | 56 | 
          case ('0'):
   | 
| 58 | 57 | 
          case ('1'):
   | 
| 59 | 58 | 
          case ('2'):
   | 
| 60 | 
          case ('3'): // disabled for 3 motors
   | 
|
| 59 | 
          case ('3'): 
   | 
|
| 61 | 60 | 
    motor = cmd;  | 
| 62 | 
            intensity = 255;
   | 
|
| 63 | 
            duration = 200;
   | 
|
| 61 | 
            intensity = 127;
   | 
|
| 62 | 
            duration = 500;
   | 
|
| 64 | 63 | 
    }  | 
| 65 | 64 | 
     | 
| 66 | 65 | 
        if (intensity > 0) {
   | 
Also available in: Unified diff