verzameling oude spullen

This commit is contained in:
Manfred 2017-07-09 19:58:38 +02:00
commit 7ed9544283
119 changed files with 1288059 additions and 0 deletions

BIN
arduino/SafetyBoard4/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,20 @@
//*******************************************************
// FlowMeter
//*******************************************************
void setupFlowMeter() {
pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
attachInterrupt(0, pulseCounter, RISING); //and the interrupt is attached
loopTime = millis();
sei(); //enable interupts
}
void pulseCounter() { //This is the function that the interupt calls
pulseCount++; //This function measures the rising and falling edge of the hall effect sensors signal
}
void checkFlow() {
if(millis() >= (loopTime + 2000)){
Calc = (pulseCount * 60 / (7.5 * 2)); //(Pulse frequency x 60) / 7.5Q, = flow rate in L/hour
flowMenu();
pulseCount = 0;
loopTime = millis();; // Updates loopTime
}
}

Binary file not shown.

View file

@ -0,0 +1,106 @@
void firstMenu() {
lcd.begin(20, 4); // set up the LCD's number of columns and rows:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Manfreds lasercutter"); // Print a message to the LCD.
lcd.setCursor(0, 1);
lcd.print("Password?");
lcd.setCursor(0, 2);
lcd.print("Press * to confirm");
}
void menuPasswordReset(){
lcd.setCursor(0, 4);
lcd.print(" "); //empty "Wrong"
}
void menuPasswordWrong(){
lcd.setCursor(0, 3);
lcd.print("Wrong");
}
void checkMenu() {
if (menuType==1) {
lcd.setCursor(0,0);
lcd.print("Manfreds lasercutter");
lcd.setCursor(0,1);
lcd.print("press * for choices ");
} else {
lcd.setCursor(0,0);
lcd.print("press * for back ");
lcd.setCursor(0,1);
lcd.print("1 air-assist 2 vent ");
lcd.setCursor(0,2);
lcd.print("3 watercool 4 laser ");
lcd.setCursor(0,3);
lcd.print("6 testmode 0 off 9 on ");
}
char key = kpd.getKey();
}
void flowMenu(){
if (menuType==1) {
lcd.setCursor(0, 3);
lcd.print(" Water");
lcd.setCursor(11, 3);
lcd.print(Calc, DEC); //Prints the number calculated abov
lcd.print (" L/h "); //Prints "L/hour" a
}
}
void menuKeypadEvent(KeypadEvent eKey) {
switch (kpd.getState()){
case PRESSED:
switch (eKey){
case '*':
if (menuType==1) {
menuType=2;
lcd.clear();
} else {
menuType = 1;
lcd.clear();
}
break;
case '#':
password.reset();
break;
case '9':
digitalWrite(airAssistPin, LOW);
digitalWrite(ventilationPin, LOW);
digitalWrite(waterCoolerPin, LOW);
digitalWrite(laserEnablePin, LOW);
digitalWrite(lichtPin, LOW); // sets the licht pin (inverted) on
digitalWrite(testEnablePin, HIGH); // sets the test enable pin ()
digitalWrite(potMeterEnable, HIGH); // sets the watercooler fans on
break;
case '0':
digitalWrite(airAssistPin, HIGH);
digitalWrite(ventilationPin, HIGH);
digitalWrite(waterCoolerPin, HIGH);
digitalWrite(laserEnablePin, HIGH);
digitalWrite(lichtPin, HIGH); // sets the licht pin (inverted) on
digitalWrite(testEnablePin, HIGH); // sets the test enable pin ()
digitalWrite(potMeterEnable, HIGH); // sets the watercooler fans off
break;
case '1':
digitalWrite(airAssistPin, !digitalRead(airAssistPin));
break;
case '2':
digitalWrite(ventilationPin, !digitalRead(ventilationPin));
break;
case '3':
digitalWrite(waterCoolerPin, !digitalRead(waterCoolerPin));
break;
case '4':
digitalWrite(laserEnablePin, !digitalRead(laserEnablePin));
break;
case '5':
digitalWrite(lichtPin, !digitalRead(lichtPin));
break;
case '6':
digitalWrite(testEnablePin, !digitalRead(testEnablePin));
digitalWrite(potMeterEnable, !digitalRead(potMeterEnable));
break;
case '7':
break;
default:
password.append(eKey);
}
}
}

View file

@ -0,0 +1,41 @@
//#include "safetyboard.h";
//******************************************************
// Password related stuff
//******************************************************
//take care of some special events
void pwdKeypadEvent(KeypadEvent eKey) {
switch (kpd.getState()){
case PRESSED:
menuPasswordReset();
switch (eKey){
case '*':
checkPassword();
break;
case '#':
password.reset();
break;
default:
password.append(eKey);
}
}
}
void checkPassword() {
if (password.evaluate()) {
Serial.println("Success");
lcd.clear();
passwordCorrect = true;
setupFlowMeter();
digitalWrite(airAssistPin, LOW); // sets the airAssist on
digitalWrite(ventilationPin, LOW); // sets the air ventilation on
digitalWrite(waterCoolerPin, LOW); // sets the watercooler fans on
digitalWrite(laserEnablePin, LOW); // sets the watercooler fans on
digitalWrite(lichtPin, LOW); // sets the licht pin (inverted) on
digitalWrite(powerWH, LOW); // sets the waterpump and high voltage on
menuType = 1; // inportant information
kpd.addEventListener(menuKeypadEvent); //add an event listener for this keypad
} else {
Serial.println("Wrong");
password.reset();
menuPasswordWrong();
}
}

View file

@ -0,0 +1,46 @@
void pulseCounter(); //
void setupFlowMeter(); //
void checkFlow() ;
void flowMenu();
void getInfo(); //here we get info like temp etc
void checkMenu();
void firstMenu();
void pwdKeypadEvent();
void menuKeypadEvent();
void choiceMenu() ;
int menuType = 0;
int potMeterEnable = 46;
int testEnablePin = 47;
int lichtPin = 49;
int laserEnablePin = 50;
int waterCoolerPin = 51;
int airAssistPin = 52;
int ventilationPin = 53;
int powerWH = 48;
LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
int passwordCorrect = false;
Password password = Password( "123456" );
const byte ROWS = 4; // Four rows
const byte COLS = 3; // Three columns
char keys[ROWS][COLS] = { // Define the Keymap
{ '1','2','3' } ,
{ '4','5','6' } ,
{ '7','8','9' } ,
{ '*','0','#' } };
byte rowPins[ROWS] = { 15, 20, 17, 19 }; // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte colPins[COLS] = { 18, 14, 16 }; // Connect keypad COL0, COL1 and COL2 to these Arduino pins.
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); // Create the Keypad
float tempIn;
float tempOut;
int tempPinIn = 0;
int tempPinOut = 0;
volatile int pulseCount; //measuring the rising edges of the signal
int Calc;
int hallsensor = 2; //The pin location of the sensor
unsigned long loopTime;

View file

@ -0,0 +1,36 @@
#include <LiquidCrystal.h>
#include <Keypad.h>
#include <Password.h>
#include "safetyboard.h"
void setup() {
pinMode(airAssistPin, OUTPUT); // sets the digital pin as output
pinMode(ventilationPin, OUTPUT); // sets the digital pin as output
pinMode(waterCoolerPin, OUTPUT); // sets the digital pin as output
pinMode(laserEnablePin, OUTPUT); // sets the digital pin as output
pinMode(lichtPin, OUTPUT); // sets the digital pin as output
pinMode(testEnablePin, OUTPUT); // sets the digital pin as output
pinMode(potMeterEnable, OUTPUT); // sets the digital pin as output
pinMode(powerWH, OUTPUT); // sets the digital pin as output
digitalWrite(airAssistPin, HIGH); // sets the airAssist off
digitalWrite(ventilationPin, HIGH); // sets the air ventilation off
digitalWrite(waterCoolerPin, HIGH); // sets the watercooler off
digitalWrite(laserEnablePin, HIGH); // sets the laserEnable off
digitalWrite(lichtPin, HIGH); // sets the licht pin (inverted) off
digitalWrite(testEnablePin, HIGH); // sets the test enable pin () off
digitalWrite(potMeterEnable, HIGH); // sets the watercooler fans off
digitalWrite(powerWH, HIGH); // sets the waterpump and high voltage off
Serial.begin(9600);
firstMenu();
kpd.addEventListener(pwdKeypadEvent); //add an event listener for this keypad
}
void loop() {
if (passwordCorrect) {
checkMenu();
checkFlow();
} else {
kpd.getKey();
}
}