Skip to content
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 82 commits into from
Dec 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
13fa1f7
Initial commit
Oct 2, 2013
ab5550a
Added WeatherStation.ino file which Hannah Dalgliesch and Josh Walawe…
joshwalawender Oct 25, 2013
57f9c01
Added DSLR_Controller.ino, has skeleton of code for three commands (e…
joshwalawender Dec 18, 2013
7c5360a
Moved DSLR_Controller.ino to folder named DSLR_Controller to make Ard…
joshwalawender Dec 20, 2013
a69a680
Changes to DSLR_Controller.ino to handle commands.
joshwalawender Dec 20, 2013
e517720
Moved WeatherStation.ino to WeatherStation folder to make Arduino IDE…
joshwalawender Dec 20, 2013
71553e5
Complete refactoring to handle serial exchanges differently. This co…
joshwalawender Jan 30, 2014
2050628
Basic accelerometer output for camera box
wtgee Sep 7, 2014
dd23dec
Adding DHT22 temp & humidity; output in valid json
wtgee Sep 7, 2014
8277380
Adding support libraries
wtgee Sep 7, 2014
d092061
Updates to Arduino code; reading all sensors
wtgee Dec 8, 2014
e5e2300
Renaming files
wtgee Dec 8, 2014
d6d992b
Organizing arudino files better
wtgee Dec 12, 2014
80159a0
Turn on fan
wtgee Dec 12, 2014
f0da3f5
Merge branch 'develop' of github.com:panoptes/PACE into develop
wtgee Dec 12, 2014
09a94cb
Removing old code, removing comma for proper json
wtgee Dec 12, 2014
d5f6ed3
Update to serial output
wtgee Dec 17, 2014
848c1aa
Renaming some of the sensors
wtgee Dec 17, 2014
27f653e
Cleaning up arduino file
wtgee Dec 17, 2014
41b5563
Comment out reporting on ds18b20
wtgee Dec 17, 2014
3c7051b
Comment cleanup
wtgee Dec 17, 2014
f1fe69d
Move delay into main loop instead of blink_lead; rename blink_led to …
wtgee Dec 17, 2014
b29ef22
Fixing the temperature readout for ds18b20
wtgee Dec 17, 2014
6e97893
Cleaning up arduino code
wtgee Dec 17, 2014
956e722
Fixing arduino sensors
wtgee Dec 17, 2014
5052312
Add the fan status to the arduino output message
wtgee Dec 21, 2014
198a073
Adding a simple counter
wtgee Dec 21, 2014
98e5916
Reset counter if it gets (arbitrarily) too large
wtgee Dec 21, 2014
2f7de46
Format
wtgee Dec 21, 2014
20a593c
Adding simple counter; adding commas to fix some readout; turning off…
wtgee Dec 21, 2014
d00087c
Fixing comma erroa
wtgee Dec 21, 2014
d21e7d7
Changing counter reset value
wtgee Dec 22, 2014
fa60242
Use millis() instead of counter
wtgee Dec 25, 2014
9afc438
Use millis() intead of counter
wtgee Dec 25, 2014
9634be9
Adding serial input support to control fan
wtgee Dec 25, 2014
8440a0f
Support reading serial in so we can toggle cameras (and led); cleanin…
wtgee Dec 25, 2014
099c0f3
Use pin names
wtgee Dec 25, 2014
7389749
Pin variables are const; using LED_BUILTIN
wtgee Jan 1, 2015
80c70be
Format
wtgee Jan 1, 2015
b1e9b2a
define to const; organize
wtgee Jan 1, 2015
a2fc7d5
format
wtgee Jan 1, 2015
a234426
Getting rid of extra commas
wtgee Jan 1, 2015
daf67ec
Updated values for the computer box
wtgee Mar 13, 2015
7333136
Format
wtgee Jun 27, 2015
e548b31
Cleanup
wtgee Jun 27, 2015
0a56ae5
Cleanup and docs
wtgee Jun 27, 2015
d880088
Formatting
wtgee Jun 27, 2015
fa4ba69
Giving costants all-caps names
wtgee Jun 27, 2015
800e422
Consts gets caps
wtgee Jun 27, 2015
af95be2
Updating libraries
wtgee Mar 9, 2016
eae75a8
Adding reste
wtgee Mar 9, 2016
e22c2bd
Delete Test_DSLR.py
wtgee Mar 10, 2016
d2571b1
Removing cruft
wtgee Mar 10, 2016
dbdaeff
Create LICENSE
wtgee Jul 13, 2016
fc8c096
Update LICENSE
wtgee Jul 13, 2016
507faf0
Create CONTRIBUTING.md
wtgee Jul 21, 2016
221bd38
Flush the output fully
wtgee Aug 20, 2016
d5b894f
* Telemetry Board (former computer box)
wtgee Mar 2, 2017
f9522ba
Rename camera_box.ino to camera_board.ino
wtgee Mar 3, 2017
c4b6b15
Making directory names consistent with files
wtgee Mar 12, 2017
d4caea2
* Consistent pins names with each other
wtgee Mar 13, 2017
7d925fa
Updates to camera board and telemetry board for new electroncs
wtgee Mar 27, 2017
5004f4e
Adding toggle method
wtgee Mar 27, 2017
5a2e20b
* Adding names to electronic board output
wtgee Mar 27, 2017
8f31925
Add files via upload
blackflip14 Jul 20, 2017
1c4a1e6
Add files via upload
blackflip14 Jul 27, 2017
8e41671
Update mount_Current_Sensing.ino
blackflip14 Jul 27, 2017
cae00de
Update mount_Current_Sensing.ino
blackflip14 Jul 27, 2017
dffc170
Remove the convenience method to shut down everything (#1)
wtgee Aug 6, 2017
08dd9d8
Merge pull request #2 from panoptes/issue-1
jamessynge Aug 10, 2017
7d47a86
Moving files into resources dir for merge
wtgee Nov 6, 2017
f694c03
Removing unncessary files
wtgee Nov 6, 2017
86658fb
MOving libraries for arudino files into resources dir
wtgee Nov 6, 2017
9b5d480
Removing meta files - see #6
wtgee Nov 6, 2017
91fa0bc
Removing unused libraries
wtgee Nov 8, 2017
9b0c17e
Merge pull request #7 from panoptes/pre-merge-clean-5
wtgee Nov 8, 2017
ab8d6a3
Create README.md
wtgee Nov 21, 2017
2bc303f
Create LICENSE
wtgee Nov 21, 2017
5380606
Merging PACE
wtgee Dec 3, 2017
b8f8cb4
Merge branch 'pace-merge' into merge-PACE
wtgee Dec 3, 2017
14b421e
Removing unused arduino sketches
wtgee Dec 3, 2017
58b0fc6
Adding changelog entry
wtgee Dec 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## [Unreleased]
### Added
Copy link
Contributor

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?

Copy link
Member Author

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.

- Merge PACE into POCS

## [0.5.1] - 2017-12-02
### Added
Expand Down
165 changes: 165 additions & 0 deletions resources/arduino_files/camera_board/camera_board.ino
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);
}
Loading