Hi, I have just started using the uno board. Previously always used nano boards. On the nano board I can use a subroutine meaning a routine outside the main void loop. In the main loop I use
phase(); to get to the subroutine called void phase() . The subroutine is using if(digitalRead(k)==HIGH && state==LOW) . Then do something in the subroutine. k is digital pin 7. It is measuring a short high going pulse on pin 7.
It fails on the uno board using the same pin 7. I am guessing that the ordinary digital pins on the uno board cannot measure short high going pulses and you perhaps can only use the interrupt pins. I am not using an interrupt to get to the subroutine on the nano board.
Has anybody on the forum come across this problem with the uno board?
The Nano and Uno share the same programming environment and processor so if you use pin 7 on one you can use it on the other
The Nano has extra analog pins A7, A6, so when you say "pin 7" are you referring to pin 7 or pin A7 ?
Post a sketch that compiles on a Nano and not on a Uno
The processors are the same so the behaviour is the same. The only thing that is different is the length of the tracks on the board. Which can be important when measuring high frequency signals; but you did not provide the details.
And obviously your wiring is physically different which can have an influence.
Please provide more details. Are you using a breadboard? How is the setup with the Nano versus the setup with the Uno. Are you sure you haven't forgotten a GND connection somewhere?
I am using a solderless breadboard. The nano board is better because you can plug it in directly to the breadboard. With the uno you have to connect wires from the board to the breadboard. Pity the nano doesn't have the same neat plug in power supply as the uno. I use a varta battery charger which provides 240vac connection to a 12vdc output.
I use a cellular phone charger for the nano board which is a switchmode ac adapter providing a 7 vdc output for the vin pin.
digital pin 7 not analog7. Using digital pin 8 as output to opto coupler for mains connection. Sorry for not providing a sketch Bob but it would require too much explaining and this topic would go on forever.
Please post a clear picture of your setup. Help us help you!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.