Commit Iniziale, progetto funzionante caricato su box ETcontroller in
cantina
This commit is contained in:
BIN
MAX6675/.hg/00changelog.i
Normal file
BIN
MAX6675/.hg/00changelog.i
Normal file
Binary file not shown.
2
MAX6675/.hg/cache/branchheads
vendored
Normal file
2
MAX6675/.hg/cache/branchheads
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
01ccbb10ca4c68bf969ad05ce25c6d71564bd289 1
|
||||
01ccbb10ca4c68bf969ad05ce25c6d71564bd289 default
|
||||
1
MAX6675/.hg/cache/nooutgoing
vendored
Normal file
1
MAX6675/.hg/cache/nooutgoing
vendored
Normal file
@@ -0,0 +1 @@
|
||||
01ccbb10ca4c68bf969ad05ce25c6d71564bd289 1
|
||||
2
MAX6675/.hg/cache/tags
vendored
Normal file
2
MAX6675/.hg/cache/tags
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
1 01ccbb10ca4c68bf969ad05ce25c6d71564bd289
|
||||
|
||||
BIN
MAX6675/.hg/dirstate
Normal file
BIN
MAX6675/.hg/dirstate
Normal file
Binary file not shown.
26
MAX6675/.hg/hgignore
Normal file
26
MAX6675/.hg/hgignore
Normal file
@@ -0,0 +1,26 @@
|
||||
syntax: glob
|
||||
.hg
|
||||
.git
|
||||
.svn
|
||||
.CVS
|
||||
.cvs
|
||||
*.orig
|
||||
.build
|
||||
.export
|
||||
.msub
|
||||
.meta
|
||||
.ctags*
|
||||
*.uvproj
|
||||
*.uvopt
|
||||
*.project
|
||||
*.cproject
|
||||
*.launch
|
||||
*.ewp
|
||||
*.eww
|
||||
Makefile
|
||||
Debug
|
||||
*.htm
|
||||
*.settings
|
||||
mbed_settings.py
|
||||
*.py[cod]
|
||||
# subrepo ignores
|
||||
4
MAX6675/.hg/hgrc
Normal file
4
MAX6675/.hg/hgrc
Normal file
@@ -0,0 +1,4 @@
|
||||
[ui]
|
||||
ignore.local = .hg/hgignore
|
||||
[paths]
|
||||
default = https://developer.mbed.org/teams/Lab-Measurements-2017/code/MAX6675_New/
|
||||
1
MAX6675/.hg/last-message.txt
Normal file
1
MAX6675/.hg/last-message.txt
Normal file
@@ -0,0 +1 @@
|
||||
Lettura Termocoppie
|
||||
4
MAX6675/.hg/requires
Normal file
4
MAX6675/.hg/requires
Normal file
@@ -0,0 +1,4 @@
|
||||
revlogv1
|
||||
fncache
|
||||
store
|
||||
dotencode
|
||||
BIN
MAX6675/.hg/store/00changelog.i
Normal file
BIN
MAX6675/.hg/store/00changelog.i
Normal file
Binary file not shown.
BIN
MAX6675/.hg/store/00manifest.i
Normal file
BIN
MAX6675/.hg/store/00manifest.i
Normal file
Binary file not shown.
BIN
MAX6675/.hg/store/data/_m_a_x6675.cpp.i
Normal file
BIN
MAX6675/.hg/store/data/_m_a_x6675.cpp.i
Normal file
Binary file not shown.
BIN
MAX6675/.hg/store/data/_m_a_x6675.h.i
Normal file
BIN
MAX6675/.hg/store/data/_m_a_x6675.h.i
Normal file
Binary file not shown.
2
MAX6675/.hg/store/fncache
Normal file
2
MAX6675/.hg/store/fncache
Normal file
@@ -0,0 +1,2 @@
|
||||
data/MAX6675.cpp.i
|
||||
data/MAX6675.h.i
|
||||
0
MAX6675/.hg/store/phaseroots
Normal file
0
MAX6675/.hg/store/phaseroots
Normal file
BIN
MAX6675/.hg/store/undo
Normal file
BIN
MAX6675/.hg/store/undo
Normal file
Binary file not shown.
1
MAX6675/.hg/store/undo.phaseroots
Normal file
1
MAX6675/.hg/store/undo.phaseroots
Normal file
@@ -0,0 +1 @@
|
||||
1 915f5679c7938d04cc7b9f548dc11a403dbf675b
|
||||
0
MAX6675/.hg/undo.bookmarks
Normal file
0
MAX6675/.hg/undo.bookmarks
Normal file
1
MAX6675/.hg/undo.branch
Normal file
1
MAX6675/.hg/undo.branch
Normal file
@@ -0,0 +1 @@
|
||||
default
|
||||
2
MAX6675/.hg/undo.desc
Normal file
2
MAX6675/.hg/undo.desc
Normal file
@@ -0,0 +1,2 @@
|
||||
1
|
||||
commit
|
||||
BIN
MAX6675/.hg/undo.dirstate
Normal file
BIN
MAX6675/.hg/undo.dirstate
Normal file
Binary file not shown.
31
MAX6675/MAX6675.cpp
Normal file
31
MAX6675/MAX6675.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "MAX6675.h"
|
||||
|
||||
Thermo::Thermo(SPI* dev=0, PinName p=D0){
|
||||
device = dev;
|
||||
cs = new DigitalOut(p);
|
||||
cs->write(OFF);
|
||||
}
|
||||
|
||||
Thermo::~Thermo(){
|
||||
cs->write(OFF);
|
||||
device->unlock();
|
||||
}
|
||||
|
||||
char Thermo::readTemp(float* temp){
|
||||
uint16_t data,t,s;
|
||||
readRaw(&data);
|
||||
t=(data & 0x7FF8)>>3;
|
||||
s=(data & 0x0004)>>2;
|
||||
*temp=t*0.25;
|
||||
return s;
|
||||
}
|
||||
|
||||
void Thermo::readRaw(uint16_t* data){
|
||||
uint16_t d;
|
||||
cs->write(ON);
|
||||
device->lock();
|
||||
d=device->write(0x0000);
|
||||
device->unlock();
|
||||
cs->write(OFF);
|
||||
*data = d;
|
||||
}
|
||||
19
MAX6675/MAX6675.h
Normal file
19
MAX6675/MAX6675.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <mbed.h>
|
||||
|
||||
#define ON 0
|
||||
#define OFF 1
|
||||
#define MAX6675_ERROR 1
|
||||
#define MAX6675_OK 0
|
||||
|
||||
class Thermo {
|
||||
public:
|
||||
Thermo(SPI* dev, PinName p);
|
||||
virtual ~Thermo();
|
||||
|
||||
char readTemp(float* temp);
|
||||
void readRaw(uint16_t* data);
|
||||
|
||||
private:
|
||||
SPI *device;
|
||||
DigitalOut *cs;
|
||||
};
|
||||
1
MAX6675/MAX6675.lib
Normal file
1
MAX6675/MAX6675.lib
Normal file
@@ -0,0 +1 @@
|
||||
https://developer.mbed.org/teams/Lab-Measurements-2017/code/MAX6675_New/#01ccbb10ca4c
|
||||
Reference in New Issue
Block a user