-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge PACE #167
Merged
Merged
Merge PACE #167
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
13fa1f7
Initial commit
ab5550a
Added WeatherStation.ino file which Hannah Dalgliesch and Josh Walawe…
joshwalawender 57f9c01
Added DSLR_Controller.ino, has skeleton of code for three commands (e…
joshwalawender 7c5360a
Moved DSLR_Controller.ino to folder named DSLR_Controller to make Ard…
joshwalawender a69a680
Changes to DSLR_Controller.ino to handle commands.
joshwalawender e517720
Moved WeatherStation.ino to WeatherStation folder to make Arduino IDE…
joshwalawender 71553e5
Complete refactoring to handle serial exchanges differently. This co…
joshwalawender 2050628
Basic accelerometer output for camera box
wtgee dd23dec
Adding DHT22 temp & humidity; output in valid json
wtgee 8277380
Adding support libraries
wtgee d092061
Updates to Arduino code; reading all sensors
wtgee e5e2300
Renaming files
wtgee d6d992b
Organizing arudino files better
wtgee 80159a0
Turn on fan
wtgee f0da3f5
Merge branch 'develop' of github.com:panoptes/PACE into develop
wtgee 09a94cb
Removing old code, removing comma for proper json
wtgee d5f6ed3
Update to serial output
wtgee 848c1aa
Renaming some of the sensors
wtgee 27f653e
Cleaning up arduino file
wtgee 41b5563
Comment out reporting on ds18b20
wtgee 3c7051b
Comment cleanup
wtgee f1fe69d
Move delay into main loop instead of blink_lead; rename blink_led to …
wtgee b29ef22
Fixing the temperature readout for ds18b20
wtgee 6e97893
Cleaning up arduino code
wtgee 956e722
Fixing arduino sensors
wtgee 5052312
Add the fan status to the arduino output message
wtgee 198a073
Adding a simple counter
wtgee 98e5916
Reset counter if it gets (arbitrarily) too large
wtgee 2f7de46
Format
wtgee 20a593c
Adding simple counter; adding commas to fix some readout; turning off…
wtgee d00087c
Fixing comma erroa
wtgee d21e7d7
Changing counter reset value
wtgee fa60242
Use millis() instead of counter
wtgee 9afc438
Use millis() intead of counter
wtgee 9634be9
Adding serial input support to control fan
wtgee 8440a0f
Support reading serial in so we can toggle cameras (and led); cleanin…
wtgee 099c0f3
Use pin names
wtgee 7389749
Pin variables are const; using LED_BUILTIN
wtgee 80c70be
Format
wtgee b1e9b2a
define to const; organize
wtgee a2fc7d5
format
wtgee a234426
Getting rid of extra commas
wtgee daf67ec
Updated values for the computer box
wtgee 7333136
Format
wtgee e548b31
Cleanup
wtgee 0a56ae5
Cleanup and docs
wtgee d880088
Formatting
wtgee fa4ba69
Giving costants all-caps names
wtgee 800e422
Consts gets caps
wtgee af95be2
Updating libraries
wtgee eae75a8
Adding reste
wtgee e22c2bd
Delete Test_DSLR.py
wtgee d2571b1
Removing cruft
wtgee dbdaeff
Create LICENSE
wtgee fc8c096
Update LICENSE
wtgee 507faf0
Create CONTRIBUTING.md
wtgee 221bd38
Flush the output fully
wtgee d5b894f
* Telemetry Board (former computer box)
wtgee f9522ba
Rename camera_box.ino to camera_board.ino
wtgee c4b6b15
Making directory names consistent with files
wtgee d4caea2
* Consistent pins names with each other
wtgee 7d925fa
Updates to camera board and telemetry board for new electroncs
wtgee 5004f4e
Adding toggle method
wtgee 5a2e20b
* Adding names to electronic board output
wtgee 8f31925
Add files via upload
blackflip14 1c4a1e6
Add files via upload
blackflip14 8e41671
Update mount_Current_Sensing.ino
blackflip14 cae00de
Update mount_Current_Sensing.ino
blackflip14 dffc170
Remove the convenience method to shut down everything (#1)
wtgee 08dd9d8
Merge pull request #2 from panoptes/issue-1
jamessynge 7d47a86
Moving files into resources dir for merge
wtgee f694c03
Removing unncessary files
wtgee 86658fb
MOving libraries for arudino files into resources dir
wtgee 9b5d480
Removing meta files - see #6
wtgee 91fa0bc
Removing unused libraries
wtgee 9b0c17e
Merge pull request #7 from panoptes/pre-merge-clean-5
wtgee ab8d6a3
Create README.md
wtgee 2bc303f
Create LICENSE
wtgee 5380606
Merging PACE
wtgee b8f8cb4
Merge branch 'pace-merge' into merge-PACE
wtgee 14b421e
Removing unused arduino sketches
wtgee 58b0fc6
Adding changelog entry
wtgee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
## [Unreleased] | ||
### Added | ||
- Merge PACE into POCS | ||
|
||
## [0.5.1] - 2017-12-02 | ||
### Added | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
#include <Wire.h> | ||
#include <stdlib.h> | ||
#include <Adafruit_MMA8451.h> | ||
#include <Adafruit_Sensor.h> | ||
#include <DHT.h> | ||
|
||
#define DHT_TYPE DHT22 // DHT 22 (AM2302) | ||
|
||
/* DECLARE PINS */ | ||
const int DHT_PIN = 9; // DHT Temp & Humidity Pin | ||
const int CAM_01_RELAY = 5; | ||
const int CAM_02_RELAY = 6; | ||
const int RESET_PIN = 12; | ||
|
||
|
||
/* CONSTANTS */ | ||
Adafruit_MMA8451 accelerometer = Adafruit_MMA8451(); | ||
|
||
// Setup DHT22 | ||
DHT dht(DHT_PIN, DHT_TYPE); | ||
|
||
int led_value = LOW; | ||
|
||
void setup(void) { | ||
Serial.begin(9600); | ||
Serial.flush(); | ||
|
||
// Turn off LED inside camera box | ||
pinMode(LED_BUILTIN, OUTPUT); | ||
digitalWrite(LED_BUILTIN, LOW); | ||
|
||
// Setup Camera relays | ||
pinMode(CAM_01_RELAY, OUTPUT); | ||
pinMode(CAM_02_RELAY, OUTPUT); | ||
|
||
pinMode(RESET_PIN, OUTPUT); | ||
|
||
// Turn on Camera relays | ||
turn_pin_on(CAM_01_RELAY); | ||
turn_pin_on(CAM_02_RELAY); | ||
|
||
if (! accelerometer.begin()) { | ||
while (1); | ||
} | ||
|
||
dht.begin(); | ||
|
||
// Check Accelerometer range | ||
// accelerometer.setRange(MMA8451_RANGE_2_G); | ||
// Serial.print("Accelerometer Range = "); Serial.print(2 << accelerometer.getRange()); | ||
// Serial.println("G"); | ||
} | ||
|
||
void loop() { | ||
|
||
// Read any serial input | ||
// - Input will be two comma separated integers, the | ||
// first specifying the pin and the second the status | ||
// to change to (1/0). Cameras and debug led are | ||
// supported. | ||
// Example serial input: | ||
// 4,1 # Turn fan on | ||
// 13,0 # Turn led off | ||
while (Serial.available() > 0) { | ||
int pin_num = Serial.parseInt(); | ||
int pin_status = Serial.parseInt(); | ||
|
||
switch (pin_num) { | ||
case CAM_01_RELAY: | ||
case CAM_02_RELAY: | ||
if (pin_status == 1) { | ||
turn_pin_on(pin_num); | ||
} else if (pin_status == 0) { | ||
turn_pin_off(pin_num); | ||
} else if (pin_status == 9) { | ||
toggle_pin(pin_num); | ||
} | ||
break; | ||
case RESET_PIN: | ||
if (pin_status == 1) { | ||
turn_pin_off(RESET_PIN); | ||
} | ||
break; | ||
case LED_BUILTIN: | ||
digitalWrite(pin_num, pin_status); | ||
break; | ||
} | ||
} | ||
|
||
// Begin reading values and outputting as JSON string | ||
Serial.print("{"); | ||
|
||
read_status(); | ||
|
||
read_accelerometer(); | ||
|
||
read_dht_temp(); | ||
|
||
Serial.print("\"name\":\"camera_board\""); Serial.print(","); | ||
|
||
Serial.print("\"count\":"); Serial.print(millis()); | ||
|
||
Serial.println("}"); | ||
|
||
Serial.flush(); | ||
delay(1000); | ||
} | ||
|
||
void read_status() { | ||
|
||
Serial.print("\"power\":{"); | ||
Serial.print("\"camera_00\":"); Serial.print(is_pin_on(CAM_01_RELAY)); Serial.print(','); | ||
Serial.print("\"camera_01\":"); Serial.print(is_pin_on(CAM_02_RELAY)); Serial.print(','); | ||
Serial.print("},"); | ||
} | ||
|
||
/* ACCELEROMETER */ | ||
void read_accelerometer() { | ||
/* Get a new sensor event */ | ||
sensors_event_t event; | ||
accelerometer.getEvent(&event); | ||
uint8_t o = accelerometer.getOrientation(); // Orientation | ||
|
||
Serial.print("\"accelerometer\":{"); | ||
Serial.print("\"x\":"); Serial.print(event.acceleration.x); Serial.print(','); | ||
Serial.print("\"y\":"); Serial.print(event.acceleration.y); Serial.print(','); | ||
Serial.print("\"z\":"); Serial.print(event.acceleration.z); Serial.print(','); | ||
Serial.print("\"o\": "); Serial.print(o); | ||
Serial.print("},"); | ||
} | ||
|
||
//// Reading temperature or humidity takes about 250 milliseconds! | ||
//// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) | ||
void read_dht_temp() { | ||
float h = dht.readHumidity(); | ||
float c = dht.readTemperature(); // Celsius | ||
|
||
Serial.print("\"humidity\":"); Serial.print(h); Serial.print(','); | ||
Serial.print("\"temp_00\":"); Serial.print(c); Serial.print(","); | ||
} | ||
|
||
/************************************ | ||
* Utitlity Methods | ||
*************************************/ | ||
|
||
void toggle_led() { | ||
led_value = ! led_value; | ||
digitalWrite(LED_BUILTIN, led_value); | ||
} | ||
|
||
void toggle_pin(int pin_num) { | ||
digitalWrite(pin_num, !digitalRead(pin_num)); | ||
} | ||
|
||
void turn_pin_on(int camera_pin) { | ||
digitalWrite(camera_pin, HIGH); | ||
} | ||
|
||
void turn_pin_off(int camera_pin) { | ||
digitalWrite(camera_pin, LOW); | ||
} | ||
|
||
int is_pin_on(int camera_pin) { | ||
return digitalRead(camera_pin); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I'm a bit skeptical about using a file like this for tracking major changes that should be included release notes. One issue is that we'll have frequent conflicts on this file as there will be many changes at the same point in the file.
I wonder if using the github PR "labels" feature would be useful here (e.g. mark new features with FEATURE and mark notable bug fixes with BUGFIX). Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially these are the release notes.
I couldn't quite figure out what to do about the frequent conflicts either. It's an issue when there are multiple outstanding Feature PRs that you want to merge at once.
The idea is to alleviate the work on whomever is doing the release so they don't have to dig back through everything that has been changed since last release.
Definitely open to other suggestions.