Advertisement
pleasedontcode

Analog Communication rev_01

May 20th, 2024
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: Analog Communication
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2024-05-20 09:21:25
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* I am using Arduino uno for a project   The project */
  21.     /* idea is I'm going to send an audio signal through */
  22.     /* the Arduino uno and take output through it.  The */
  23.     /* function is whatever the signal audio signal is */
  24.     /* given the output must me in the decibel which I */
  25.     /* will */
  26. /****** END SYSTEM REQUIREMENTS *****/
  27.  
  28. /****** DEFINITION OF LIBRARIES *****/
  29.  
  30. #include <Arduino.h>
  31.  
  32. /****** FUNCTION PROTOTYPES *****/
  33. void setup(void);
  34. void loop(void);
  35.  
  36. /***** DEFINITION OF ANALOG INPUT PINS *****/
  37. const uint8_t potentiometer_Potentiometer_Vout_PIN_A0 = A0;
  38. const uint8_t potentiometer_Potentiometer_Vout_PIN_A1 = A1;
  39.  
  40. void setup(void)
  41. {
  42.     // put your setup code here, to run once:
  43.  
  44.     pinMode(potentiometer_Potentiometer_Vout_PIN_A0, INPUT);
  45.     pinMode(potentiometer_Potentiometer_Vout_PIN_A1, INPUT);
  46.  
  47.     // Initialize serial communication
  48.     Serial.begin(9600);
  49. }
  50.  
  51. void loop(void)
  52. {
  53.     // put your main code here, to run repeatedly:
  54.  
  55.     // Read analog input values
  56.     int sensorValue_A0 = analogRead(potentiometer_Potentiometer_Vout_PIN_A0);
  57.     int sensorValue_A1 = analogRead(potentiometer_Potentiometer_Vout_PIN_A1);
  58.  
  59.     // Print the sensor values to the serial monitor
  60.     Serial.print("Sensor Value A0: ");
  61.     Serial.println(sensorValue_A0);
  62.     Serial.print("Sensor Value A1: ");
  63.     Serial.println(sensorValue_A1);
  64.  
  65.     // Delay for readability
  66.     delay(1000);
  67. }
  68.  
  69. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement