Pages: 1 [2]   Go Down
Author Topic: Carpark entry counter  (Read 914 times)
0 Members and 1 Guest are viewing this topic.
Dinmore, QLD, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Oh fate most cruel, to be thusly boned!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Once again, thanks for all your help so far !

what i have now is a working counter/ a working web server/ and a working(to a point-but thats not a worry just yet) clock.
now what i can't get to play nice, is the SD card writing.
I have it attempting to write to the SD card every 10sec(will eventually be every hour, but 10sec will do for testing)
It keeps failing to init the card.

all the 1000ms delays in my code are just to slow it down;  they will eventually be removed--- it was originally scrambling the serial output and the SD card writings, adding these got rid of that, but also stopped the card inits from working

now it says initialise failed, but when i view the card on my pc, it has actually created the "traffic.txt" file.

I have added a line "sd.remove" to clear the card again, just incase it is a "file exists" type of problem.
should i have a line to check for the file instead?



Also, it appears to be looping back into my SETUP () constantly.....i would have thought this would only run once?

I have code to change the SPI pins(4 and 10) to mirror what i am trying to achieve at each point, but that does not appear to have helped.

Something of note is that the LED on board(D13) is flickering constantly, but i have nothing writing to it?

i have spent a couple of days on this problem now, and i just can't figure it out.
I have attached the sketch file below ,

Please, if you could?
Regards
Jason




* counter_sd_fail.ino (14.85 KB - downloaded 7 times.)
« Last Edit: May 10, 2013, 09:53:56 pm by JsGarage » Logged

one day, I'll be able to do this without help smiley

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46266
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also, it appears to be looping back into my SETUP () constantly.....i would have thought this would only run once?
Classic out-of-memory action.

Use the F() macro with all of your string literals:
      client.println(F("HTTP/1.1 200 OK"));
Logged

Dinmore, QLD, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Oh fate most cruel, to be thusly boned!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That seems to have done the trick, thanks PaulS !


I did a few other tweaks as well, and now have all functions running in total harmony smiley-grin


Is there a way to pull the time from a network adapter or something? this board will be running standalone once its installed, with just an ethernet link to the outside world. (no internet access)



current code is attached smiley


Regards
Jason

* countertimefault.ino (17.54 KB - downloaded 3 times.)
« Last Edit: May 12, 2013, 03:26:49 pm by JsGarage » Logged

one day, I'll be able to do this without help smiley

Mid-Atlantic, USA
Offline Offline
Sr. Member
****
Karma: 22
Posts: 459
"Remember kids, the only difference between Science and screwing around is writing it down." - Adam Savage
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

[... trim ...]
Something of note is that the LED on board(D13) is flickering constantly, but i have nothing writing to it?


Not sure if you have realized what is happening with D13. I went through a similar issue with once before I realized the obvious... D13 is used by writing to the SD because it is also the SPI MISO pin. So every time you write or read from the SD card the LED essentially gets a PWM signal. If the flickering looks random enough, extend it to a LED in a candle-shaped enclosure. If the candle is flickering, you haven't crashed. Kinda a cute indicator for actual deployment. smiley-wink
Logged


Pages: 1 [2]   Go Up
Jump to: