All submissions

PWM High-Frequency Generation

Solving Approach:

How do you plan to solve it?

 

 

Code

/*Paste your code here*/


#define POT_PIN A0
#define MOTOR_PIN 5 

int pot_value=0, mapped_value=0;

void deriveMotor(int v)
{
  analogWrite(MOTOR_PIN,v);
}

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  pot_value = analogRead(POT_PIN);

  mapped_value = map(pot_value,0,1023,0,255);

  deriveMotor(mapped_value);
}

 

Output

Video

Add video of output (know more)

 

 

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

 

 

 

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!