Странная проблема!


#1

У меня есть большая проблема в mBlock 5 с Arduino Uno. Очень странная:

Часть кода
%D0%A7%D0%B0%D1%81%D1%82%D1%8C%20%D0%BA%D0%BE%D0%B4%D0%B0-
работает также, как и
-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%D0%B5%D1%82%20%D1%82%D0%B0%D0%BA%20%D0%B6%D0%B5%2C%20%D1%87%D1%82%D0%BE%20%D0%B8-
.

Верно ведь? Но если запустить
%D0%A7%D0%B0%D1%81%D1%82%D1%8C%20%D0%BA%D0%BE%D0%B4%D0%B0-
то всё пойдёт не так, как хотелось бы. Потому что после этого цифровой порт — вы не представляете — останется ВКЛЮЧЕННЫМ! Даже если перед этой частью кода будет блок
-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%D0%B5%D1%82%20%D1%82%D0%B0%D0%BA%20%D0%B6%D0%B5%2C%20%D1%87%D1%82%D0%BE%20%D0%B8-
!
Скажите пожалуйста, почему код так странно себя ведёт?


#2

Hi Oleg,

I may suggest that you can publish the question and screenshoot in english. Sorry that it is really difficult for us to understand the problem when you describe it in Russian.


#3

“Strange problem: English version.”

I have a big problem in mBlock 5 with Arduino Uno. Very strange:

Part of the %D0%A7%D0%B0%D1%81%D1%82%D1%8C%20%D0%BA%D0%BE%D0%B4%D0%B0-%20! code works the same as -%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%D0%B5%D1%82%20%D1%82%D0%B0%D0%BA%20%D0%B6%D0%B5%2C%20%D1%87%D1%82%D0%BE%20%D0%B8-%20!. Is that right? But if you run %D0%A7%D0%B0%D1%81%D1%82%D1%8C%20%D0%BA%D0%BE%D0%B4%D0%B0-%20! then everything will go wrong as we would like. Because after that, the digital port - you can not imagine - will remain ON! Even if there is an -%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%D0%B5%D1%82%20%D1%82%D0%B0%D0%BA%20%D0%B6%D0%B5%2C%20%D1%87%D1%82%D0%BE%20%D0%B8-%20! block before this part of the code!

Please tell me why the code behaves so strangely?


#4

Hi Oleg,

It looks like there is no difference between the two parts of the program. I am not sure why you say the second part program go wrong and the first part program works.

Besides, do you intentionally always set the digital port output [13] to low in the if [] else [] condition program block?


#5

Yes. Arduino Uno run this parts of program.


#6

I mean “runs”