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
The heating element will begin to coast upon nearing the target temperature, but what kind of control must there be over this coasting? PID (an algorithm that smoothes out the approach to any target value) would be one way to prevent overshooting, but it employs PWM (rapidly switching on/off) which drastically reduces a relay's life cycle :( The simple solution? Just calculate the time between turning off the heat and achieving a temperature 'apex.' Hard-code this time period into the relay control. |
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
/* | |
compile with Visual Studio C++ command prompt using: | |
cl -LD dlllauschen.cpp -Felauschen.dll | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <windows.h> | |
#include "hidapi.h" | |
#pragma comment(lib, "hidapi.lib") |
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
#ifndef HARDWARE_PROFILE_H | |
#define HARDWARE_PROFILE_H | |
// Defines required for the USB stack | |
//#define PROGRAMMABLE_WITH_USB_HID_BOOTLOADER | |
#define self_power 1 | |
/*#define USE_SELF_POWER_SENSE_IO | |
#define tris_self_power TRISBbits.TRISB0 // Input | |
#define self_power RB0*/ |