void setup() { Serial.begin(9600); } void loop() { // print labels Serial.print("number"); // the label Serial.print("\t\t"); // prints a tab Serial.print("DEC"); Serial.print("\t"); Serial.print("BIN"); Serial.println(); // signals the end of the line for (int x = 0; x < 11; x++) { // I want values from 1-10 Serial.print(x); // print as decimal Serial.print("\t\t"); // prints two tabs to spesify label lenght Serial.print(x, DEC); // print as an ASCII-encoded decimal Serial.print("\t"); // prints a tab Serial.println(x, BIN); // print as an ASCII-encoded binary // after printing goes to a new line with "println" delay(200); // delay 200 milliseconds } Serial.println(); // prints another carriage return } kirjaimilla sama void setup() { Serial.begin(9600); } void loop() { char ch; // declares the variable // print labels Serial.print("letter"); // the label Serial.print("\t\t"); // prints a tab Serial.print("DEC"); Serial.print("\t"); Serial.print("BIN"); Serial.println(); // signals the end of the line for (ch = 'a'; ch <= 'z'; ch++) { // I want values from a to z Serial.print(ch); // print as decimal Serial.print("\t\t"); // prints two tabs to spesify label lenght Serial.print(ch, DEC); // print as an ASCII-encoded decimal Serial.print("\t"); // prints a tab Serial.println(ch, BIN); // print as an ASCII-encoded binary // after printing goes to a new line with "println" delay(200); // delay 200 milliseconds } Serial.println(); // prints another carriage return } alkupr. pixel #include int Power = 11; int PIN = 12; #define NUMPIXELS 1 Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); void setup() { pixels.begin(); pinMode(Power,OUTPUT); digitalWrite(Power, HIGH); } void loop() { pixels.clear(); pixels.setPixelColor(0, pixels.Color(15, 25, 205)); delay(400); pixels.show(); pixels.clear(); pixels.setPixelColor(0, pixels.Color(103, 25, 205)); delay(400); pixels.show(); pixels.clear(); pixels.setPixelColor(0, pixels.Color(233, 242, 205)); delay(400); pixels.show(); pixels.clear(); pixels.setPixelColor(0, pixels.Color(233, 23, 23)); delay(400); pixels.show(); pixels.clear(); pixels.setPixelColor(0, pixels.Color(12, 66, 101)); delay(400); pixels.show(); delay(500); } muutettu väri #include int Power = 11; int PIN = 12; #define NUMPIXELS 1 Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); void setup() { pixels.begin(); pinMode(Power,OUTPUT); digitalWrite(Power, HIGH); } void loop() { pixels.clear(); pixels.setPixelColor(0, pixels.Color(0, 255, 0)); delay(400); pixels.show(); pixels.clear(); pixels.setPixelColor(0, pixels.Color(0, 128, 0)); delay(400); pixels.show(); pixels.clear(); pixels.setPixelColor(0, pixels.Color(107, 142, 35)); delay(400); pixels.show(); pixels.clear(); pixels.setPixelColor(0, pixels.Color (0, 255, 127)); delay(400); pixels.show(); pixels.clear(); pixels.setPixelColor(0, pixels.Color(85, 107, 47)); delay(400); pixels.show(); delay(500); } hello world: void setup() { Serial.begin(9600); } void loop() { Serial.println("Daniel Graig is the best Bond!"); delay(1000); } Next, we want to decode the inputs and print them out as ASCII characters, instead of integers. This will later allow us to control pins based on input characters. Below, the input can be decoded by first reading the input as a “char” and then printing that “char” variable just as above: void setup() { Serial.begin(9600); } void loop() { while (Serial.available()){ char in_char = Serial.read(); Serial.println(in_char); } }