Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IoT Code
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aurian.foulner
IoT Code
Commits
341bb76d
Commit
341bb76d
authored
Jan 15, 2024
by
aurian.foulner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
sketch_jan14
sketch_jan14
+31
-0
No files found.
sketch_jan14
0 → 100644
View file @
341bb76d
#include <SPI.h>
#include "ThingSpeak.h"
#include <WiFiNINA.h>
const int pinTemp = A0;
const int B = 3975;
const char ssid[] = "VM1043083";
const char password[] = "xvyg3tntKgtk";
const unsigned long channel_id = 2402218;
const char write_api_key = "DA7EMSRE1MB5TGXG";
WiFiClient client;
void setup() {
Serial.begin(9600);
Serial.print("Connecting to ");
Serial.print(ssid);
WiFi.begin(ssid, password);
Serial.println();
Serial.println("Connected");
ThingSpeak.begin(client);
}
void loop() {
int value = analogRead(pinTemp);
float res = (float)(1023-value)*10000/value;
float temp = 1/(log(res/10000)/B+1/298.15)-273.15;
Serial.println(temp);
Serial.println("Posting" + String(temp, 2)+ " to ThingSpeak");
ThingSpeak.setField(1, String(temp, 2));
ThingSpeak.writeFields(channel_id, write_api_key);
delay(3000);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment