Page 36 - DYNO TTRAINER
P. 36

Programming codes for load resistor numerical control:






                              void setup() {

                                Serial.begin(9600);


                                for (int thisPin = 6; thisPin < 10; thisPin++) {


                                  pinMode(thisPin, OUTPUT);

                                }


                              }




                              void loop() {

                                if (Serial.available() > 0) {


                                  int inByte = Serial.read();




                                  switch (inByte) {


                                    case 'a':

                                      digitalWrite(9, LOW);


                                      break;

                                    case 'b':


                                      digitalWrite(9, LOW);


                                      digitalWrite(6, LOW);

                                      break;


                                    case 'c':
   31   32   33   34   35   36   37   38   39   40   41