Проблема с выводом в serial
- Войдите на сайт для отправки комментариев
Вс, 26/06/2022 - 16:12
Уважаемые форумчане помогите разобраться с проблемой. При выводе в порт получаю всякую хрень...
Драйвера стоят CH341SER (nano китайская) в мониторе порта 9600.
/* * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv * An IR detector/demodulator must be connected to the input RECV_PIN. * Version 0.1 July, 2009 * Copyright 2009 Ken Shirriff * http://arcfn.com */ #include <IRremote.h> int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } }
Выводит всякую хрень. Типа "?х???хххх?хх"
а в самом мониторе порта внизу справа скорость 9600 выставил?
а в самом мониторе порта внизу справа скорость 9600 выставил?
а ардуина какая?
а ардуина какая?
nano 3.0/328p (с алика)
а ардуина какая?
nano 3.0/328p (с алика)
этот код попробуй, что пишет?
/ constants won't change. Used here to set a pin number: const int ledPin = LED_BUILTIN;// the number of the LED pin // Variables will change: int ledState = LOW; // ledState used to set the LED // Generally, you should use "unsigned long" for variables that hold time // The value will quickly become too large for an int to store unsigned long previousMillis = 0; // will store last time LED was updated // constants won't change: const long interval = 1000; // interval at which to blink (milliseconds) void setup() { Serial.begin(9600); // set the digital pin as output: pinMode(ledPin, OUTPUT); } void loop() { // here is where you'd put code that needs to be running all the time. // check to see if it's time to blink the LED; that is, if the difference // between the current time and last time you blinked the LED is bigger than // the interval at which you want to blink the LED. unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= interval) { // save the last time you blinked the LED previousMillis = currentMillis; // if the LED is off turn it on and vice-versa: if (ledState == LOW) { ledState = HIGH; Serial.println("LED is ON"); } else { ledState = LOW; Serial.println("LED is OFF"); } // set the LED with the ledState of the variable: digitalWrite(ledPin, ledState); } }а ардуина какая?
nano 3.0/328p (с алика)
этот код попробуй, что пишет?
/ constants won't change. Used here to set a pin number: const int ledPin = LED_BUILTIN;// the number of the LED pin // Variables will change: int ledState = LOW; // ledState used to set the LED // Generally, you should use "unsigned long" for variables that hold time // The value will quickly become too large for an int to store unsigned long previousMillis = 0; // will store last time LED was updated // constants won't change: const long interval = 1000; // interval at which to blink (milliseconds) void setup() { Serial.begin(9600); // set the digital pin as output: pinMode(ledPin, OUTPUT); } void loop() { // here is where you'd put code that needs to be running all the time. // check to see if it's time to blink the LED; that is, if the difference // between the current time and last time you blinked the LED is bigger than // the interval at which you want to blink the LED. unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= interval) { // save the last time you blinked the LED previousMillis = currentMillis; // if the LED is off turn it on and vice-versa: if (ledState == LOW) { ledState = HIGH; Serial.println("LED is ON"); } else { ledState = LOW; Serial.println("LED is OFF"); } // set the LED with the ledState of the variable: digitalWrite(ledPin, ledState); } }отфотографируй свою ардуино, что-то тут не то...
отфотографируй свою ардуино, что-то тут не то...
ожидаемо, что это важгад )))
ставь ядро и будет тебе счастье
https://raw.githubusercontent.com/dbuezas/lgt8fx/master/package_lgt8fx_index.json
ожидаемо, что это важгад )))
ставь ядро и будет тебе счастье
https://raw.githubusercontent.com/dbuezas/lgt8fx/master/package_lgt8fx_index.json
Все сделал!!! Спасибо огромное за помощь. Сам бы хрен допер)))
Все сделал!!! Спасибо огромное за помощь. Сам бы хрен допер)))
на будущее - это не ардуина, это вавгат.
Все сделал!!! Спасибо огромное за помощь. Сам бы хрен допер)))
на будущее - это не ардуина, это вавгат.
А я вот ни разу такую бяку не покупал. Что там за чип специфический такой стоит? Какая-то копия атмела?
А я вот ни разу такую бяку не покупал. Что там за чип специфический такой стоит? Какая-то копия атмела?
тут есть отдельная тема по нему https://arduino.ru/forum/apparatnye-voprosy/obzor-klona-megi328-lgt8f328p