IP Configuration

This commit is contained in:
Gašper Dobrovoljc
2023-03-11 15:11:03 +01:00
commit ec125f27db
662 changed files with 103738 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:
- **Do not use GitHub issues for troubleshooting projects and issues.** Instead use
the forums at http://forums.adafruit.com to ask questions and troubleshoot why
something isn't working as expected. In many cases the problem is a common issue
that you will more quickly receive help from the forum community. GitHub issues
are meant for known defects in the code. If you don't know if there is a defect
in the code then start with troubleshooting on the forum first.
- **If following a tutorial or guide be sure you didn't miss a step.** Carefully
check all of the steps and commands to run have been followed. Consult the
forum if you're unsure or have questions about steps in a guide/tutorial.
- **For Arduino projects check these very common issues to ensure they don't apply**:
- For uploading sketches or communicating with the board make sure you're using
a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes
very hard to tell the difference between a data and charge cable! Try using the
cable with other devices or swapping to another cable to confirm it is not
the problem.
- **Be sure you are supplying adequate power to the board.** Check the specs of
your board and plug in an external power supply. In many cases just
plugging a board into your computer is not enough to power it and other
peripherals.
- **Double check all soldering joints and connections.** Flakey connections
cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints.
- **Ensure you are using an official Arduino or Adafruit board.** We can't
guarantee a clone board will have the same functionality and work as expected
with this code and don't support them.
If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:
- Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE**
- Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO
VERSION HERE**
- List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): **LIST REPRO STEPS BELOW**

View File

@@ -0,0 +1,26 @@
Thank you for creating a pull request to contribute to Adafruit's GitHub code!
Before you open the request please review the following guidelines and tips to
help it be more easily integrated:
- **Describe the scope of your change--i.e. what the change does and what parts
of the code were modified.** This will help us understand any risks of integrating
the code.
- **Describe any known limitations with your change.** For example if the change
doesn't apply to a supported platform of the library please mention it.
- **Please run any tests or examples that can exercise your modified code.** We
strive to not break users of the code and running tests/examples helps with this
process.
Thank you again for contributing! We will try to test and integrate the change
as soon as we can, but be aware we have many GitHub repositories to manage and
can't immediately respond to every request. There is no need to bump or check in
on a pull request (it will clutter the discussion of the request).
Also don't be worried if the request is closed or not integrated--sometimes the
priorities of Adafruit's GitHub code (education, ease of use) might not match the
priorities of the pull request. Don't fret, the open source community thrives on
forks and GitHub makes it easy to keep your changes in a forked repo.
After reviewing the guidelines above you can delete this text from the pull request.

View File

@@ -0,0 +1,178 @@
/***************************************************
This is a library for the Adafruit Thermocouple Sensor w/MAX31855K
Designed specifically to work with the Adafruit Thermocouple Sensor
----> https://www.adafruit.com/products/269
These displays use SPI to communicate, 3 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include "Adafruit_MAX31855.h"
#ifdef __AVR
#include <avr/pgmspace.h>
#elif defined(ESP8266)
#include <pgmspace.h>
#endif
#include <stdlib.h>
#include <SPI.h>
Adafruit_MAX31855::Adafruit_MAX31855(int8_t _sclk, int8_t _cs, int8_t _miso) {
sclk = _sclk;
cs = _cs;
miso = _miso;
initialized = false;
}
Adafruit_MAX31855::Adafruit_MAX31855(int8_t _cs) {
cs = _cs;
sclk = miso = -1;
initialized = false;
}
void Adafruit_MAX31855::begin(void) {
//define pin modes
pinMode(cs, OUTPUT);
digitalWrite(cs, HIGH);
if (sclk == -1) {
// hardware SPI
//start and configure hardware SPI
SPI.begin();
} else {
pinMode(sclk, OUTPUT);
pinMode(miso, INPUT);
}
initialized = true;
}
double Adafruit_MAX31855::readInternal(void) {
uint32_t v;
v = spiread32();
// ignore bottom 4 bits - they're just thermocouple data
v >>= 4;
// pull the bottom 11 bits off
float internal = v & 0x7FF;
// check sign bit!
if (v & 0x800) {
// Convert to negative value by extending sign and casting to signed type.
int16_t tmp = 0xF800 | (v & 0x7FF);
internal = tmp;
}
internal *= 0.0625; // LSB = 0.0625 degrees
//Serial.print("\tInternal Temp: "); Serial.println(internal);
return internal;
}
double Adafruit_MAX31855::readCelsius(void) {
int32_t v;
v = spiread32();
//Serial.print("0x"); Serial.println(v, HEX);
/*
float internal = (v >> 4) & 0x7FF;
internal *= 0.0625;
if ((v >> 4) & 0x800)
internal *= -1;
Serial.print("\tInternal Temp: "); Serial.println(internal);
*/
if (v & 0x7) {
// uh oh, a serious problem!
return NAN;
}
if (v & 0x80000000) {
// Negative value, drop the lower 18 bits and explicitly extend sign bits.
v = 0xFFFFC000 | ((v >> 18) & 0x00003FFFF);
}
else {
// Positive value, just drop the lower 18 bits.
v >>= 18;
}
//Serial.println(v, HEX);
double centigrade = v;
// LSB = 0.25 degrees C
centigrade *= 0.25;
return centigrade;
}
uint8_t Adafruit_MAX31855::readError() {
return spiread32() & 0x7;
}
double Adafruit_MAX31855::readFarenheit(void) {
float f = readCelsius();
f *= 9.0;
f /= 5.0;
f += 32;
return f;
}
uint32_t Adafruit_MAX31855::spiread32(void) {
int i;
uint32_t d = 0;
// backcompatibility!
if (! initialized) {
begin();
}
digitalWrite(cs, LOW);
delay(1);
if(sclk == -1) {
// hardware SPI
SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
d = SPI.transfer(0);
d <<= 8;
d |= SPI.transfer(0);
d <<= 8;
d |= SPI.transfer(0);
d <<= 8;
d |= SPI.transfer(0);
SPI.endTransaction();
} else {
// software SPI
digitalWrite(sclk, LOW);
delay(1);
for (i=31; i>=0; i--) {
digitalWrite(sclk, LOW);
delay(1);
d <<= 1;
if (digitalRead(miso)) {
d |= 1;
}
digitalWrite(sclk, HIGH);
delay(1);
}
}
digitalWrite(cs, HIGH);
//Serial.println(d, HEX);
return d;
}

View File

@@ -0,0 +1,44 @@
/***************************************************
This is a library for the Adafruit Thermocouple Sensor w/MAX31855K
Designed specifically to work with the Adafruit Thermocouple Sensor
----> https://www.adafruit.com/products/269
These displays use SPI to communicate, 3 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#ifndef ADAFRUIT_MAX31855_H
#define ADAFRUIT_MAX31855_H
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
class Adafruit_MAX31855 {
public:
Adafruit_MAX31855(int8_t _sclk, int8_t _cs, int8_t _miso);
Adafruit_MAX31855(int8_t _cs);
void begin(void);
double readInternal(void);
double readCelsius(void);
double readFarenheit(void);
uint8_t readError();
private:
boolean initialized;
int8_t sclk, miso, cs;
uint32_t spiread32(void);
};
#endif

View File

@@ -0,0 +1,32 @@
# Adafruit-MAX31855-library
<!-- START COMPATIBILITY TABLE -->
## Compatibility
MCU | Tested Works | Doesn't Work | Not Tested | Notes
------------------ | :----------: | :----------: | :---------: | -----
Atmega328 @ 16MHz | X | | |
Atmega328 @ 12MHz | X | | | For LCD example had to move pin 7.
Atmega32u4 @ 16MHz | X | | |
Atmega32u4 @ 8MHz | X | | |
ESP8266 | X | | |
Atmega2560 @ 16MHz | X | | |
ATSAM3X8E | X | | |
ATSAM21D | X | | |
ATtiny85 @ 16MHz | | X | |
ATtiny85 @ 8MHz | | X | |
Intel Curie @ 32MHz | | | X |
STM32F2 | | | X |
* ATmega328 @ 16MHz : Arduino UNO, Adafruit Pro Trinket 5V, Adafruit Metro 328, Adafruit Metro Mini
* ATmega328 @ 12MHz : Adafruit Pro Trinket 3V
* ATmega32u4 @ 16MHz : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0
* ATmega32u4 @ 8MHz : Adafruit Flora, Bluefruit Micro
* ESP8266 : Adafruit Huzzah
* ATmega2560 @ 16MHz : Arduino Mega
* ATSAM3X8E : Arduino Due
* ATSAM21D : Arduino Zero, M0 Pro
* ATtiny85 @ 16MHz : Adafruit Trinket 5V
* ATtiny85 @ 8MHz : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 3V
<!-- END COMPATIBILITY TABLE -->

View File

@@ -0,0 +1,19 @@
This is the Adafruit MAX31885 Arduino Library
Tested and works great with the Adafruit Thermocouple Breakout w/MAX31885K
------> http://www.adafruit.com/products/269
These modules use SPI to communicate, 3 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution
To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_MAX31885. Check that the Adafruit_MAX31885 folder contains Adafruit_MAX31885.cpp and Adafruit_MAX31885.h
Place the Adafruit_MAX31885 library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

View File

@@ -0,0 +1,77 @@
/***************************************************
This is an example for the Adafruit Thermocouple Sensor w/MAX31855K
Designed specifically to work with the Adafruit Thermocouple Sensor
----> https://www.adafruit.com/products/269
These displays use SPI to communicate, 3 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include <SPI.h>
#include <Wire.h>
#include "Adafruit_MAX31855.h"
#include <LiquidCrystal.h>
// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO 3
#define MAXCS 4
#define MAXCLK 5
// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
#if defined(ARDUINO_ARCH_SAMD)
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
#define Serial SerialUSB
#endif
void setup() {
#ifndef ESP8266
while (!Serial); // will pause Zero, Leonardo, etc until serial console opens
#endif
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.clear();
lcd.print("MAX31855 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Int. Temp = ");
lcd.println(thermocouple.readInternal());
Serial.print("Int. Temp = ");
Serial.println(thermocouple.readInternal());
double c = thermocouple.readCelsius();
lcd.setCursor(0, 1);
if (isnan(c))
{
lcd.print("T/C Problem");
}
else
{
lcd.print("C = ");
lcd.print(c);
lcd.print(" ");
Serial.print("Thermocouple Temp = *");
Serial.println(c);
}
delay(1000);
}

View File

@@ -0,0 +1,63 @@
/***************************************************
This is an example for the Adafruit Thermocouple Sensor w/MAX31855K
Designed specifically to work with the Adafruit Thermocouple Sensor
----> https://www.adafruit.com/products/269
These displays use SPI to communicate, 3 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include <SPI.h>
#include "Adafruit_MAX31855.h"
// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:
// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO 3
#define MAXCS 4
#define MAXCLK 5
// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);
// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
//#define MAXCS 10
//Adafruit_MAX31855 thermocouple(MAXCS);
void setup() {
Serial.begin(9600);
while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc
Serial.println("MAX31855 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("Internal Temp = ");
Serial.println(thermocouple.readInternal());
double c = thermocouple.readCelsius();
if (isnan(c)) {
Serial.println("Something wrong with thermocouple!");
} else {
Serial.print("C = ");
Serial.println(c);
}
//Serial.print("F = ");
//Serial.println(thermocouple.readFarenheit());
delay(1000);
}

View File

@@ -0,0 +1,21 @@
#######################################
# Syntax Coloring Map for NewSoftSerial
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
max6675 KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
readCelsius KEYWORD2
readFarenheit KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################

View File

@@ -0,0 +1,9 @@
name=Adafruit MAX31855 library
version=1.0.3
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Library for the Adafruit Thermocouple breakout with MAX31855K
paragraph=Library for the Adafruit Thermocouple breakout with MAX31855K
category=Sensors
url=https://github.com/adafruit/Adafruit-MAX31855-library
architectures=*

View File

@@ -0,0 +1,26 @@
Software License Agreement (BSD License)
Copyright (c) 2012, Adafruit Industries
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.