-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/fablabs-ch/bar-o-matic
- Loading branch information
Showing
57 changed files
with
11,242 additions
and
416 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8,090 changes: 8,090 additions & 0 deletions
8,090
3d_model/Laser/SupportDistributeur_2/FrontSupport.DXF
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
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,7 @@ | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.{ino,h,cpp}] | ||
indent_style = space | ||
indent_size = 4 |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
#include "pressure.h" | ||
|
||
Pressure::Pressure(int pinPressure, int pinPump, int targetPressure): pinPressure(pinPressure), | ||
pinPump(pinPump), targetPressure(targetPressure){ | ||
this->targetPressureStart = targetPressure-TARGET_PRESSURE_HYSTERESIS; | ||
this->targetPressureStop = targetPressure+TARGET_PRESSURE_HYSTERESIS; | ||
} | ||
|
||
long Pressure::getCurrentPressure(){ | ||
return this->currentPressure; | ||
} | ||
|
||
void Pressure::run(unsigned long dtMs){ | ||
this->currentPressure = readPressure(); //stupid, to remove | ||
if(this->currentPressure<this->targetPressureStart){ | ||
digitalWrite(this->pinPump, HIGH); | ||
} | ||
if(this->currentPressure>this->targetPressureStop){ | ||
digitalWrite(this->pinPump, LOW); | ||
} | ||
} | ||
|
||
double Pressure::readPressure(){ | ||
double adc0 = (double)analogRead(this->pinPressure); | ||
double erreurV = -0.17; | ||
double vout = adc0 * 0.004883 + erreurV; | ||
double pressure = (vout * 0.2 - 0.04) *1111.111111111; | ||
return pressure; | ||
} |
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,30 @@ | ||
#ifndef PRESSURE_H | ||
#define PRESSURE_H | ||
|
||
#include <Arduino.h> | ||
|
||
// in pression unit | ||
#define TARGET_PRESSURE_HYSTERESIS 100 | ||
|
||
class Pressure | ||
{ | ||
public: | ||
Pressure(int pinPressionSensor, int pinPump, int targetPression); | ||
|
||
void run(unsigned long dtMs); | ||
|
||
long getCurrentPressure(); | ||
|
||
private: | ||
int pinPressure; | ||
int pinPump; | ||
int targetPressure; | ||
long currentPressure = -1; | ||
int targetPressureStop; | ||
int targetPressureStart; | ||
|
||
double readPressure(); | ||
|
||
}; | ||
|
||
#endif |
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,23 @@ | ||
#include "status.h" | ||
#include <Arduino.h> | ||
|
||
|
||
Status::Status(Stream *serial, int *weightGrPtr, int *carrierMmPtr, Pressure *pressure): serial(serial), weightGrPtr(weightGrPtr), | ||
carrierMmPtr(carrierMmPtr), pressure(pressure){ | ||
this->acc = 0; | ||
} | ||
|
||
void Status::run(unsigned long dtMs){ | ||
this->acc += dtMs; | ||
if(acc>=STATUS_DELAY_MS){ | ||
this->serial->print("s:"); | ||
this->serial->print(*this->carrierMmPtr); | ||
this->serial->print(':'); | ||
this->serial->print(*this->weightGrPtr); | ||
this->serial->print(':'); | ||
this->serial->println(this->pressure->getCurrentPressure()); | ||
|
||
this->acc = 0; | ||
} | ||
} | ||
|
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,24 @@ | ||
#ifndef STATUS_H | ||
#define STATUS_H | ||
|
||
#include <Arduino.h> | ||
#include "pressure.h" | ||
|
||
#define STATUS_DELAY_MS 100 | ||
|
||
class Status | ||
{ | ||
public: | ||
Status(Stream *serial, int *weightGrPtr, int *carrierMmPtr, Pressure *pressure); | ||
|
||
void run(unsigned long dtMs); | ||
|
||
private: | ||
unsigned long acc; | ||
Stream *serial; | ||
int *weightGrPtr; | ||
int *carrierMmPtr; | ||
Pressure *pressure; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.