Tell us about yourself!
- ayshaa commented on cartonerdd's instructable DC Motor Control With Bluetooth
- ayshaa commented on cartonerdd's instructable DC motor control with BluetoothView Instructable »
we changed the program (Arduino IDE) a little
- ayshaa completed the lesson Beads in the class Jewelry Class
- ayshaa commented on cartonerdd's instructable DC motor control with BluetoothView Instructable »
we do it as our mini project...we changed the program a little to get the output...anyway thank you very much
#include <PWM.h>int motorout = 9; int speeds = 0; // how bright the LED is // how many points to fade the LED byint32_t frequency = 35; //frequency (in Hz) void setup(void){ InitTimersSafe(); SetPinFrequencySafe(motorout, frequency); Serial.begin(9600); while (!Serial) { ; } establishContact(); }void loop(void){ if (Serial.available() > 0) { char inByte = Serial.read(); if (inByte == 'A') { speeds = 100; pwmWrite(motorout, speeds); } else if (inByte == 'B') { speeds = 150; pwmWrite(motorout, speeds); } if (inByte == 'C') { speeds = 200; pwmWrite(motorout, speeds); } if (inByte == 'D') { speeds = 250; pwmWrite(motorout, speeds); } …
see more »#include <PWM.h>int motorout = 9; int speeds = 0; // how bright the LED is // how many points to fade the LED byint32_t frequency = 35; //frequency (in Hz) void setup(void){ InitTimersSafe(); SetPinFrequencySafe(motorout, frequency); Serial.begin(9600); while (!Serial) { ; } establishContact(); }void loop(void){ if (Serial.available() > 0) { char inByte = Serial.read(); if (inByte == 'A') { speeds = 100; pwmWrite(motorout, speeds); } else if (inByte == 'B') { speeds = 150; pwmWrite(motorout, speeds); } if (inByte == 'C') { speeds = 200; pwmWrite(motorout, speeds); } if (inByte == 'D') { speeds = 250; pwmWrite(motorout, speeds); } if (inByte == 'O') { speeds = 0; pwmWrite(motorout, speeds); } } }void establishContact() { while (Serial.available() <= 0) { Serial.println("connect"); delay(1000); }}