Arduino_Arvalis
9. Μέτρηση απόστασης με ultrasonic
// this constant won’t change. It’s the pin number of the sensor’s output: const int pingPin = 7; void setup() { // initialize serial communication: Serial.begin(9600); } void loop() { // establish variables for duration of the ping, and the distance result // in inches and centimeters: long duration, Διαβάστε περισσότερα…