lyweilian

Member Since: July 21, 2011

Country: United States

Profile

Programming Languages

C#, C++, JAVA, ASP.net

Universities

University of Missouri - St. Louis

  • Product ROB-10335 | about 3 years ago

    I know this is very late, but here is some code that I made up between the joystick quickstart sketch and some servo example code.
    Enjoy!
    #include “Servo.h"
    // Store the Arduino pin associated with each input
    const byte PIN_ANALOG_X = 0;
    const byte PIN_ANALOG_Y = 1;
    Servo pan;
    Servo tilt;
    long currentX=0;
    long currentY=0;
    void setup() {
    Serial.begin(9600);
    pan.attach(8);
    tilt.attach(9);
    }
    void loop() {
    currentX = map((long)analogRead(PIN_ANALOG_X), 0, 1023, 0, 180);
    currentY = map((long)analogRead(PIN_ANALOG_Y), 0, 1023, 0, 180);
    Serial.print("X: ”);
    Serial.print(currentX);
    Serial.print(“, ”);
    Serial.print(“Y: ”);
    Serial.print(currentY);
    Serial.println();
    pan.write(currentX);
    tilt.write(currentY);
    }

  • Product WRL-10822 | about 3 years ago

    Anyone have any issues connecting to a router with this module? Ive been trying the speakerjet tutorial with no success. I can telnet to it by bringing pin 8 to high for Adhoc mode and ran the cmds to set the connections, but that did not work either. Help s much appreciated. Thanks!
    EDIT: Never mind. Got it!

  • Tutorial - WiFly Wireless SpeakJet Server | about 3 years ago

    Has anyone gotten this to work with a RN-XV? Im having difficulties getting a connection to my router.

  • Tutorial - Ardumoto Quickstart Guide | about 3 years ago

    Ardumoto.cpp
    /
    Ardumoto.cpp - Library for driving the Ardumotor Driver code.
    Created by Will Ly based upon the example on Sparkfun Ardumoto Quick Start Tutorial
    Release into the public domain.
    /
    #include “WProgram.h"
    #include "Ardumoto.h"
    Ardumoto::Ardumoto(int pwmAPin, int pwmBPin, int dirAPin, int dirBPin)
    {
    pwm_a = pwmAPin;
    pwm_b = pwmBPin;
    dir_a = dirAPin;
    dir_b = dirBPin;
    pinMode(pwm_a, OUTPUT);
    pinMode(
    pwm_b, OUTPUT);
    pinMode(dir_a, OUTPUT);
    pinMode(
    dir_b, OUTPUT);
    }
    void Ardumoto::stopMotors()
    {
    digitalWrite(pwm_a, LOW);
    digitalWrite(
    pwm_b, LOW);
    setSpeed(0,0);
    }
    void Ardumoto::setSpeed(int speedMotorA, int speedMotorB)
    {
    if(speedMotorA > 0)
    {
    digitalWrite(dir_a, LOW); //Forward
    }
    else
    {
    digitalWrite(
    dir_a, HIGH); //Reverse
    }
    if(speedMotorB > 0)
    {
    digitalWrite(dir_b, LOW); //Forward
    }
    else
    {
    digitalWrite(
    dir_b, HIGH); //Reverse
    }
    analogWrite(pwm_a, abs(speedMotorA));//Left Motor
    analogWrite(
    pwm_b, abs(speedMotorB));//Right Motor
    }
    void Ardumoto::setMotorDirection(bool isForward)
    {
    stopMotors();
    if(isForward)
    {
    digitalWrite(dir_a, LOW); //Set motor direction, 1 low, 2 high
    digitalWrite(
    dir_b, LOW); //Set motor direction, 3 high, 4 low
    }
    else
    {
    digitalWrite(dir_a, HIGH); //Reverse motor direction, 1 high, 2 low
    digitalWrite(
    dir_b, HIGH); //Reverse motor direction, 3 low, 4 high
    }
    }

  • Tutorial - Ardumoto Quickstart Guide | about 3 years ago

    Don’t know if there is a library for this already out there, but I wrote a library for my project. Hope it helps someone that is stuck.
    Ardumoto.h
    /
    Ardumoto.h - Library for driving the Ardumotor Driver code.
    Created by Will Ly based upon the example on Sparkfun Ardumoto Quick Start Tutorial
    Release into the public domain.
    /
    #ifndef Ardumoto_h
    #define Ardumoto_h
    #include “WProgram.h"
    class Ardumoto
    {
    public:
    Ardumoto(int pmwAPin, int pmwBPin, int dirAPin, int dirBPin);
    void stopMotors();
    void setSpeed(int speedMotorA, int speedMotorB);
    void setMotorDirection(bool isForward);
    private:
    int pwm_a;
    int
    pwm_b;
    int dir_a;
    int
    dir_b;
    };
    #endif

No public wish lists :(