Skip to content

Commit

Permalink
Merge pull request #17 from riggtravis/community
Browse files Browse the repository at this point in the history
Community
  • Loading branch information
riggtravis authored Jun 22, 2017
2 parents 5141fa6 + c82013d commit f96a4d1
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 14 deletions.
57 changes: 57 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Contributing
So you want to become a contributor to the Bodgecycle Computer project? Oh my gosh! Come in! Sit down! Have a coffee drink of
some sort! You might not be able to tell from the names of the names of the project releases, but we love coffee around here.
As much as possible, Bodgecycle Computer users should feel welcome to be Bodgecycle Computer contributors. There are
some things that users that want to become contributors should know before they jump into the deep end.

## Code of Conduct
You absolutely must follow this project's Code of Conduct. Anyone who doesn't follow the code of conduct will not be invited to
come ride bikes. They will not be offered coffee.

## Code of Conduct
The Code of Conduct is important enough that it bears repeating. You need to follow the Code of Conduct. It was set up to help
contributors be nice to eachother. In fact, it would be best if you weren't just nice to fellow contributors but also your fellow
humans in accordance with whatever ethical system you follow. Worth noting, Travis Rigg is not a relatavist and offers a human
Code of Conduct in the form of a paper of Global Ethics which is available in PDF format upon request.

## Code of Conduct
I hope you understand by now how important the Code of Conduct is around here.

## Filing Bug Reports
All of the issue tracking for the Bodgecycle Computer project is done through GitHub.

## Suggesting New Features
Create an issue on github. Make sure the name of your issue has the following format:
[SUGGESTION] It would be the most rad if the project did this

## Setting Up Your Environment
See the installation guide in the readme.

# What Would be Good to Contribute?
Anything really. But what is most needed is bug reports. As of right now there is exactly one known bodgecycle computer. It is
currently sitting on top of dresser and not being taken out for a ride. In fact, it spends a lot of time not being taken out for
rides. In fact, it goes out on at most one ride a day, and usually not even that. It can take a long time for the process of bug
creation, bug identification, bug diagnosis, bug treatment, bug treatment testing, bug curing to happen.

It would also be super rad if you looked in the issue tracker and picked an issue you like. Please focus on software issues and
not hardware issues. The software issues are the ones that the main (only?) developer, Travis Rigg can immediately test. Hardware
issues will almost definitely get addressed after the software ones are entirely addressed.

# What is the Vision for the Project?
It is important that potential contributors know what it is that the project is trying to be. Bodgecycle Computers are meant for
people who own Arduino boards and want to build a bicycle computer on the cheap. It is nearly impossible for a Bodgecycle
Computer to compete with a storebought bicycle computer. For about \$100 you can get a bicycle computer that will do everything
you could possibly need it to do. I'm sure some crazy souls out there will likely be able to cut costs in places in order to make
an even cheaper Bodgecycle Computer, and that's good for them, but they're not the target audience. They're likely savvy enough
that if they had wanted to do such a thing, they already would have, or have done so.

# Getting in Touch
The main (only right now) developer of Bodgecycle Computer is Travis Rigg. You can reach him at rigg.travis@gmail.com. He is also
on Twitter but probably won't get back to you. Do not try to contact him on Facebook as he will get very upset and demand that
you leave him alone. If you manage to get his phone number somewhere and call him, he will get the most upset and probably call
the police. An email is definitely the best way to get in touch with Travis Rigg.

Also, please do get in touch! Travis Rigg loves talking about his soldering projects to anyone who will listen. He has a let's
split keyboard that he finished building recently that he is very proud of the solders on. He also gets really excited when
someone thinks one of his projects is neat. We're talking he goes absolutely bonkers nuts and lets everyone he knows that someone
talked to him about one of his projects.
5 changes: 5 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Here's what's going on
Enter some text here about the current state of things

# Here's what should be going on
Enter some text here about where things should be going
10 changes: 10 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Here's how my project files differ from the ones that this project has
Enter some text here describing what it is that you changed

# Here's why I changed the things that I changed
Enter some text here describing why it is that you changed what you changed

# Here's why the things that I changed are important
Enter some text here explaining why the project should make your changes a part
of the main project repository. This would be a great place to reference an
issue in the issue tracker
49 changes: 35 additions & 14 deletions bodgecycle/bodgecycle.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
* TODO:
* Introduce battery monitoring
* Reduce power usage
* Find a way to see if bearing has changed
*/

#include <SPI.h>
Expand All @@ -86,7 +87,8 @@ char logFileName[10]; // Char string to store the log file name
//////////////////////
// Log Rate Control //
//////////////////////
#define LOG_RATE 1000 // Log every second
#define DATA_AGGRESSIVENESS 10 // Controls how often data logging is scaled
unsigned int log_rate = 16384; // Start by logging every quarter of a minute
unsigned long lastLog = 0; // Global var to keep of last time we logged

/////////////////////////
Expand Down Expand Up @@ -114,6 +116,11 @@ SoftwareSerial ssGPS(ARDUINO_GPS_TX, ARDUINO_GPS_RX); // Create a SoftwareSerial
// 'Serial' on other boards this may be 'SerialUSB'
#define SerialMonitor Serial

///////////////////////
// BEARING VARIABLES //
///////////////////////
long int last_speed = 0;

void setup()
{
SerialMonitor.begin(9600);
Expand All @@ -129,27 +136,44 @@ void setup()
// Wait to start printing headers and such until there are enough satellites
while (!tinyGPS.location.isUpdated())
{
// Query the GPS unit
getGPSData();
// This code should make the gps tracker thrash less.
if ((lastLog + log_rate) <= millis())
{
// Query the GPS unit
getGPSData();

SerialMonitor.print(F("Checking for satellites. Current count: "));
SerialMonitor.println(tinyGPS.satellites.value());
SerialMonitor.print(F("Checking for satellites. Current count: "));
SerialMonitor.println(tinyGPS.satellites.value());
}
}
last_speed = tinyGPS.speed.kmph(); // Set last speed for later calculations
log_rate = 1024; // Start logging about once a second
updateFileName(); // Each time we start, create new file, increment the number
printHeader(); // Print a header at the top of the new file
}

void loop()
{
// It sure would be nice to have the log rate speed up once GPS is found.
if ((lastLog + LOG_RATE) <= millis())
{ // If it's been LOG_RATE milliseconds since the last log:
if ((lastLog + log_rate) <= millis())
{ // If it's been log_rate milliseconds since the last log:
if (tinyGPS.location.isUpdated()) // If the GPS data is vaild
{
if (logGPSData()) // Log the GPS data
{
SerialMonitor.println(F("GPS logged.")); // Print a debug message
lastLog = millis(); // Update the lastLog variable

// Adjust the log rate based on the change in speed
if ( // If the speed has changed by 5 kmph, reset the log rate
last_speed - tinyGPS.speed.kmph() < DATA_AGGRESSIVENESS ||
tinyGPS.speed.kmph() - last_speed < DATA_AGGRESSIVENESS)
{
log_rate = 1024;
} else if (!(log_rate >= 8192)) {
// At most wait about 8 seconds
log_rate = log_rate * 2;
}
}
else // If we failed to log GPS
{ // Print an error, don't update lastLog
Expand Down Expand Up @@ -246,18 +270,15 @@ void printHeader()

// Now we do the actual factual GPS tracking.
logFile = SD.open(logFileName, FILE_WRITE);

if(logFile)
{
if(logFile) {
logFile.println();
logFile.println(F("\t</metadata>"));
logFile.println(F("\t<trk><name>Ride</name><trkseg>"));

// If I do this right, all of the tags will be closed.

// Close the file.
// logFile.close();

logFile.close();
printFooter();
}
}
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ file you have recorded in some sort of
![Into the computer](http://i.imgur.com/eROZaRi.jpg)
![Again, listen for a click](http://i.imgur.com/Gzp8oLM.jpg)

## Contributing
You want to contribute? That's great! We would love to welcome you aboard. There are just a few things
you should know first. They are laid out in our
[Code of Conduct](https://github.com/riggtravis/BodgecycleComputer/blob/master/CODE_OF_CONDUCT.md) and
[Contributing Guide](https://github.com/riggtravis/BodgecycleComputer/blob/master/CONTRIBUTING.md).
Please go and read them before you do anything else.

## Limitations
However you take your Bodgecycle computer with you, be it in a sandwich bag, in
a butter tub, in an enclosure on your bike, or just loose in a jersey pocket,
Expand Down

0 comments on commit f96a4d1

Please sign in to comment.