Go Down

Topic: Carpark entry counter (Read 1 time) previous topic - next topic

JsGarage

#15
May 11, 2013, 01:56 am Last Edit: May 11, 2013, 04:53 am by JsGarage Reason: 1
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



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

PaulS

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"));

JsGarage

#17
May 12, 2013, 07:10 am Last Edit: May 12, 2013, 10:26 pm by JsGarage Reason: 1
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 :D


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 :)


Regards
Jason
one day, I'll be able to do this without help :)

Sembazuru


[... 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. ;)
http://www.catb.org/jargon/html/I/I-didn-t-change-anything-.html

Go Up