Please give me the bike speedometer code
If you want code, then I guess you have already got the hardware sorted out like which type of sensor you are using and which processor etc ?
That's not how it works here.
If you try to write some code we will try to help you get it working.
But if you want someone to do it for you.
You will have to pay someone
Go to the gigs and collaborations section of the forum for that.
It might be easier to just do a search on the Internet.
Lots of examples there.
(1x) Arduino Uno REV 3
(1x) Switch-Magnetic Reed
(1x) 10K Ohm 1/4-Watt Carbon Film Resistor
(1x) 9V Alkaline Battery
(1x) Heavy-Duty 9V Snap Connectors
(1x) PC Board with Copper
(1x) Parallax 27977-RT Serial Backlit LCD
(x2) SPST PC-Mountable Submini Toggle Switch
(2x) Male Header Pins
(1x) Female Pin Sockets
Additional Materials:
22 Gauge Wire
Solder
sand paper
plywood
wood glue
hot glue
screws
zip ties
mabdullahq:
Please give me the bike speedometer code
No!
You must have seen what Hutkikz said - it's true.
Seeing the parts list, I know that using the Magnetic reed switch with the 10K will work, as its what I run on a DAQ system for wheel speed. You are missing a magnet which should be mounted on the wheel.
As far as the other stuff, its hard to know what the uses of such things are without more of a project guide or explanation of them.
For the code, do some digging first, I would suggest using interrupts.
Work it out in parts, check that you are able to read the switch, then do some calculations on it (I'm assuming your wanting MPH or KPH), then make it mobile. Most people here are more than willing to help work out small bugs in code as long as you put in the leg work first and get at least something, but writing the whole thing for you is only going to work if you pay someone.
Well I see you found a Instructable and it's actually a pretty good one. Although that plywood box is kinda clunky.
The code presented there is good so all you should need to work out is solving the formula for the tire size for your bike.
Now that you have code, What is your question?
Hutkikz:
Well I see you found a Instructable and it's actually a pretty good one. Although that plywood box is kinda clunky.
The code presented there is good so all you should need to work out is solving the formula for the tire size for your bike.
Now that you have code, What is your question?
Ha. Well spotted.
Edit: I don't know why the code works from the radius, then calculates circumference though.
It's much easier to get an accurate circumference and enter it directly.
For my bike, I put a chalk mark on the tyre, set it at the bottom and marked the ground, then rolled the wheel forward until the tyre chalk mark was back at the bottom, marked the ground again, then measured the distance between the marks on the ground.
Edit2: And none of the variables altered in the ISR are declared as 'volatile' - not so good after all.
OldSteve:
And none of the variables altered in the ISR are declared as 'volatile' - not so good after all.
Oops missed that and I was just reading about the proper use of volatile last nite.
I agree your method of finding the circumference is much better.
Hutkikz:
Oops missed that and I was just reading about the proper use of volatile last nite.
Maybe that's why he asked for code. The 'Instructables' code might not work as expected.
I agree your method of finding the circumference is much better.
It's a bit more accurate and easier, as well as making the code simpler - there's no need for the Arduino to do the conversion at all.
When doing it the way I suggest, for best accuracy it pays to load the bike with the rider, too, to allow for the slight tyre compression.
Simply measuring the fully inflated radius doesn't account for rider weight.