You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i think there is quite another problem. Blockly picks up the wrong C++ statement causing the interrupt not seen.
\the statement for interrupt in blockly should translate int: attachInterrupt (digitalPinToInterrupt (BUTTON), switchPressed, CHANGE);
The statement should be of the form " attachInterrupt (digitalPinToInterrupt (BUTTON), switchPressed, CHANGE);" .
Issue is that the nano and uno interrupt handling is not that flexible.
to do some Realtime event handling with Otto (and nano) you must have good interrupt handling.
a. the setup should include digitalWrite (BUTTON, HIGH), this has to do with internal pullup resistor. I don't know exactly why, Arduino reference may have more info. However this is not relevant for the attach issue.
b. the interrupt attach should definitely be of the form:
attachInterrupt (digitalPinToInterrupt (BUTTON), switchPressed, CHANGE);
the attach statement which currently is in the bloc does not work for some reason. This one does. I added
8000
a buzzer with two tones to check if it really works, it does. I forgot to save that one. I don't know WHY your original attach doesn't work, requires more study or testing.
c. within the ISR you included a statement Read Digital state Pin (BUTTON) = 10 , THAT SHOULD BE 1 , OR HIGH. The 10 doesn't work. This is also not relevant to the attach issue as its inside the ISR which can be anything.
But of course the main thing is b. above, to change the attachInterrupt statement in your interrupt block. There is also info on that in the Arduino reference site.
Perhaps its possible to make two versions of your bloc, in case there is a dependency i am not aware off.
Camilo ya lo reviso porque una parte sí que hay que cambiar, pero lo otro
no estoy seguro. Esto no está probado
El mar, 11 ene 2022 a las 8:58, Camilo Parra Palacio (<
***@***.***>) escribió:
--
Óscar Ferruz Romero
*Socio fundador.*
*Tel. 620.402.168*
C/ Artajona, 17. 28039 - Madrid.
www.logix5.comwww.twitter.com/Logix5_SS <http://www.twitter.com/logix5_SS>
www.facebook.com/logix5www.instagram.com/logix5_smart_solutions
Conforme dispone el Reglamento (UE) 2016/679 del Parlamento Europeo y del
Consejo, de 27 de abril de 2016, relativo a la protección de las personas
físicas en lo referente al tratamiento de datos personales y a la libre
circulación de estos, le informamos que los datos personales facilitados y
recogidos en este e-mail y sus documentos adjuntos serán tratados e
incluidos automatizadamente en los ficheros de datos personales bajo
responsabilidad de LOGIX5 SMART SOLUTIONS, S.L. B-86129699, donde se
recogen y almacenan los datos personales con la finalidad exclusiva de
formar parte en los procesos de selección de personal, bolsa de trabajo,
contratación o gestiones relacionadas con temas laborales que se lleven a
cabo. El interesado otorga su consentimiento para el tratamiento de sus
datos personales con la finalidad anteriormente mencionada. En el supuesto
de producirse alguna modificación de sus datos personales, le solicitamos,
nos lo comunique por escrito con la única finalidad de mantenerlos
actualizados. LOGIX5 SMART SOLUTIONS, S.L. B-86129699 se compromete a
respetar su confidencialidad en el tratamiento de sus datos personales, y
le informa que tiene derecho a ejercitar los derechos ARCO (derecho de
acceso, rectificación, cancelación y oposición) de sus datos personales
mediante solicitud escrita a ***@***.***, adjuntando fotocopia del
D.N.I.
"En la vida hay tres cosas que no dan marcha atrás: la palabra pronunciada,
la flecha lanzada y la oportunidad perdida, ¿vamos a dejarla escapar?"
Activity
logix5 commentedon Jan 13, 2022
[-]Interrupts blocks bad generated code[/-][+]Blocks for Interrupts bad generated code[/+]