Pages: [1]   Go Down
Author Topic: very new to programming arduino  (Read 488 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey guys i have just recently picked up arduino programming and have been reading a few guides. i am currently trying to write a code that will count how many times the reset button is pressed on the arduino board. i saw a guide on writing a code that does this with a separate button connected to one of the pins but i am not sure if the same could be done using the built in reset button on the board. i know that to read from a button you would use digital read and specify which pin to read from but i am not sure how i would do this with the built in reset button.

also i want to play with amarino to transfer this information to an android phone via bluetooth. i have been reading a lot about this but still haven't found a definitive solution yet.

thanks guys
Logged

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1601
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That could be done with an external button too, which code you are considering?
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

italy
Offline Offline
Full Member
***
Karma: 3
Posts: 223
Muuuuu
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use the reset button you have to save your value in a non volatile memory or you will also reset your counter. Count how many times an external button is pressed is an easier project
« Last Edit: January 11, 2012, 11:08:10 am by cantore » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34173
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
how i would do this with the built in reset button.
Generally you would not. That button is only meant for reaseting it is not designed to be used by your sketch.
« Last Edit: January 11, 2012, 05:59:41 am by Grumpy_Mike » Logged

Hannover, Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i would do this with the built in reset button.

Perhaps: use the EEPROM. In the setup routine read the value from EEPROM (if it exists), increment it and store it back. In this way you can count the "boot events".

The reset button is connected to the reset pin on the µC, so you cannot use it as a "normal" button.

best regards
Andreas
Logged

http://danimathblog.blogspot.com

#define true '/'/'/'
#define false '-'-'-'

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can you explain more about the EEPROM. I am not sure what the EEPROM does on the arduino board? and why would i read from the EEPROM?
I am probably just going to end up using a external button though. This is the link i was referring to though (http://arduino.cc/en/Tutorial/ButtonStateChange)

so right now i would write a code that would "digitalread" the pin that the external button is connected to and send that through bluetooth to the android phone. i've read that amarino is a good way to send from arduino to android via bluetooth but would my code have to be changed or modified for it to send data through bluetooth. I understand it's just a different type of serial communication.

thanks for the help so far guys.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34173
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

EEPROM is non volatile memory. That is the values in in persist during reset and power down.
You have no need to use it it was just a way of doing what you asked. But then what you asked was the totally wrong thing in the first place.
Logged

Pages: [1]   Go Up
Jump to: