This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added read-from-sensor4w-delay program with substructure
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 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
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,9 @@ | ||
THIS CODE WORKS | ||
|
||
it has been checked and Demo-ed | ||
|
||
Ready to push to prod. | ||
|
||
code-revision 4 | ||
|
||
Signatur: realdcre |
17 changes: 17 additions & 0 deletions
17
read/read_from_sensor4w-delay/read_from_sensor4w-delay.ino
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,17 @@ | ||
// the setup routine runs once when you press reset: | ||
void setup() { | ||
// initialize serial communication at 9600 bits per second: | ||
Serial.begin(74880); | ||
} | ||
|
||
// the loop routine runs over and over again forever: | ||
void loop() { | ||
// read the input on analog pin 0: | ||
int sensorValue = analogRead(A0); | ||
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): | ||
float voltage = sensorValue * (5.0 / 1023.0); | ||
// print out the value you read: | ||
Serial.println(voltage); | ||
} | ||
|
||
// sign:arduinonwt/realdcre |