forked from madworm/Youyue-858D-plus
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Robert Spitzenpfeil
committed
Dec 1, 2013
1 parent
fbfc355
commit 5d29b88
Showing
3 changed files
with
235 additions
and
80 deletions.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
indent -linux -l150 youyue858d.ino | ||
indent -linux -l150 youyue858d.h | ||
|
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,62 @@ | ||
#ifndef youyoue858d_h | ||
#define youyoue858d_h | ||
|
||
typedef struct CPARAM { | ||
int16_t limit_low; | ||
int16_t limit_high; | ||
int16_t value; | ||
uint8_t eep_addr_high; | ||
uint8_t eep_addr_low; | ||
} CPARAM; | ||
|
||
#define FAN_OFF ( PORTC |= _BV(PC3) ) | ||
#define FAN_ON ( PORTC &= ~_BV(PC3) ) | ||
#define FAN_IS_ON ( !(PINC & _BV(PC3)) ) | ||
#define FAN_IS_OFF ( PINC & _BV(PC3) ) | ||
|
||
#define DIG0_OFF ( PORTB &= ~_BV(PB0) ) | ||
#define DIG1_OFF ( PORTB &= ~_BV(PB7) ) | ||
#define DIG2_OFF ( PORTB &= ~_BV(PB6) ) | ||
|
||
#define DIG0_ON ( PORTB |= _BV(PB0) ) | ||
#define DIG1_ON ( PORTB |= _BV(PB7) ) | ||
#define DIG2_ON ( PORTB |= _BV(PB6) ) | ||
|
||
#define SEGS_OFF ( PORTD = 0xFF ) | ||
|
||
// THIS IS WHERE IT GETS DANGEROUS | ||
// YOU CAN START A FIRE AND DO A LOT OF HARM WITH | ||
// THE HEATER / TRIAC COMMANDS | ||
#define TRIAC_ON ( PORTB &= ~_BV(PB1) ) | ||
#define HEATER_ON TRIAC_OFF | ||
#define TRIAC_OFF ( PORTB |= _BV(PB1) ) | ||
#define HEATER_OFF TRIAC_OFF | ||
|
||
#define SW0_PRESSED ( !(PINB & _BV(PB5)) ) | ||
#define SW1_PRESSED ( !(PINB & _BV(PB2)) ) | ||
|
||
#define REEDSW_CLOSED ( !(PINB & _BV(PB4)) ) | ||
#define REEDSW_OPEN ( PINB & _BV(PB4) ) | ||
|
||
#define SHOW_SETPOINT_TIMEOUT 2000L | ||
|
||
#define HEATER_DUTY_CYCLE_MAX 512L | ||
#define PWM_CYCLES 512L | ||
|
||
#define P_GAIN_DEFAULT 0 | ||
#define I_GAIN_DEFAULT 0 | ||
#define D_GAIN_DEFAULT 0 | ||
#define TEMP_OFFSET_CORR_DEFAULT 33 | ||
|
||
#define TEMPERATURE_AVERAGES 1000L | ||
#define TEMPERATURE_MAX_OVERSHOOT 8 | ||
#define TEMPERATURE_REACHED_MARGIN 4 | ||
#define MIN_TEMPERATURE_SP 65 | ||
#define MAX_TEMPERATURE_SP 500L | ||
#define MAX_TEMPERATURE_ERR 600L | ||
|
||
#define SAFE_TO_TOUCH_TEMPERATURE 40 | ||
#define FAN_OFF_TEMPERATURE 45 | ||
#define FAN_ON_TEMPERATURE 60 | ||
|
||
#endif |
Oops, something went wrong.