Thursday, 29 August 2013

7 Day Weight Loss 1400 calorie program




7 Day Weight Loss 1400 calorie menu - Day 1


BREAKFAST
1 Cup Skim Milk
1 Orange, medium
1 1/4 Cups Cheerios Cereal

MORNING SNACK
1 Cup Cantaloupe Melon
1/2 Cup Low Fat, Low Sodium Cottage Cheese

LUNCH
Warm Salmon Salad with Crispy Potatoes
1 Whole-Wheat Pita Bread, small
1 Cup Skim Milk
1 Fudgsicle, no sugar added

AFTERNOON SNACK
2 Tablespoons Prepared Hummus
4 Ounces Carrot Sticks

DINNER
2/3 Cup Cooked Brown Rice
1 Cup Steamed Spinach
Beef Tataki
“Cocoa-Nut” Bananas



7 Day Weight Loss 1400 calorie menu - Day 2


BREAKFAST
1 Cup Skim Milk
1 Banana, small
1 1/4 Cups Bran Flakes Cereal

MORNING SNACK
1 Fruit & Nut Granola Bar

LUNCH
A Gilding of Shrimp & Saffron Rice
1 Whole-Wheat Bread
Watermelon-Blueberry Ice Pops
AFTERNOON SNACK
1 Cup Popcorn, air popped
1 Cup Skim Milk

DINNER
1 Cup Tossed Salad Mix
1 Tablespoon Low Calorie Caesar Salad Dressing
Grilled Chicken Tenders with Cilantro Pesto
1/2 Cup Cooked Couscous
1/2 Cup Steamed Red Cabbage
1 Peach, medium



7 Day Weight Loss 1400 calorie menu - Day 3


BREAKFAST
1 Whole-Wheat English Muffin
1 Cup Skim Milk
1/2 Cup Blueberries
1 Tablespoon Creamy Peanut Butter, unsalted

MORNING SNACK
1 Apple, small

LUNCH
2 Cups Tossed Salad Mix
4 Teaspoons Vinegar & Oil Salad Dressing
Salmon Chowder
1/2 Cup Fresh Pineapple
1 Slice Reduced-Calorie Oatmeal Bran Bread

AFTERNOON SNACK
6 Ounces Nonfat Vanilla or Lemon Yogurt, Sweetened with Low-Calorie Sweetener
2 Tablespoons Low-Fat Granola Cereal with Fruit

DINNER
Lemon-Dill Green Beans 1 Cup Skim Milk
Chicken Breasts Stuffed with Pimiento Cheese
1/2 Cup Cooked Quinoa
1 Nectarine, medium




7 Day Weight Loss 1400 calorie menu - Day 4


BREAKFAST
1 Cup Skim Milk
2/3 Cup Hot Oatmeal
1 Ounce Dried Fruit
1 Tablespoon Walnuts

MORNING SNACK
1 Kiwi

LUNCH
1 Cup Tossed Salad Mix
1 Tablespoon Vinegar & Oil Salad Dressing


Lemon Chicken Stir-Fry 1/2 Cup Cooked Couscous
1 Cup Honeydew Melon

AFTERNOON SNACK
1 Cup Blackberries
1 Cup Skim Milk

DINNER
1/2 Cup Cooked Brown Rice
Pistachio-Crusted Tuna Steaks
Roasted Brussels Sprouts & Shallots
1/2 Cup Mango

7 Day Weight Loss 1400 calorie menu - Day 5


BREAKFAST
1 Scrambled Eggs
1 Corn Tortilla
2 Tablespoons Prepared Salsa
3/4 Cup Grapefruit
1 Cup Skim Milk

MORNING SNACK
6 Ounces Nonfat Vanilla or Lemon Yogurt, Sweetened with Low-Calorie Sweetener

LUNCH
1 Cup Skim Milk
1 Cup Tossed Salad Mix
1 Tablespoon Low Calorie Caesar Salad Dressing


Sweet Potato-Turkey Hash 1/2 Cup Unsweetened Applesauce

AFTERNOON SNACK
1 Ounce Whole-Wheat Pretzel

DINNER
Cauliflower & Couscous Pilaf
3/4 Cup Cooked Carrots, Sliced
Mustard-Maple Pork Tenderloin 1 Cup Grapes



7 Day Weight Loss 1400 calorie menu - Day 6

BREAKFAST
1 Cup Skim Milk
1 Whole-Wheat English Muffin
1 Tablespoon Creamy Peanut Butter
1 Tablespoon Sugar-Free Jam

MORNING SNACK
1 Orange, medium

LUNCH
Fragrant Shredded Beef Stew 1 Cup Skim Milk
1 Whole-Wheat Pita Bread, small
1 Cup Watermelon

AFTERNOON SNACK
8 Ounces Nonfat Vanilla or Lemon Yogurt, Sweetened with Low-Calorie Sweetener

DINNER
Seared Scallops with Brandied Leeks & Mushrooms 1/2 Cup Cooked Brown Rice
1 Cup Steamed Cauliflower
1 Cup Grapes



7 Day Weight Loss 1400 calorie menu - Day 7


BREAKFAST
1 Cup Skim Milk
1 Plum
Egg & Salmon Sandwich
MORNING SNACK
1 Serving Apple, small

LUNCH
1 Veggie Burger
1 Whole-Wheat Roll


Cucumber & Black-Eyed Pea Salad 1 Apricot

AFTERNOON SNACK
6 Ounces Carrot Sticks
1/4 Cup Salsa

DINNER
1 Cup Skim Milk
3/4 Cup Steamed Green Beans


Barbecue Pulled Chicken 1/2 Cup Cooked Brown Rice
1 Peach, medium

by ("JAMTeck")

    Wednesday, 28 August 2013

    Build Your Own Arduino


    Build Your Own Arduino

    Project #1 Circuit Design

    With a few inexpensive parts and a solderless breadboard you can
    quickly and easily build your own Arduino. This concept works great
    when you want to prototype a new design idea, or you don’t want to tear
    apart your design each time you need your Arduino.

    The example below shows how to hook up the components on your
    breadboard. We will go into further detail throughout this project.


    Figure 1-1: Breadboard Arduino with USB programming ability.
    Before we get started, make sure you have all the necessary items in the component list box.If you need to purchase parts you can do so from my site at www.ArduinoFun.com or in the back of this book is a listing of several sites that sell Arduino related items.

    * See note about the TTL-232R
    cable in programming options before
    purchasing.


    Build Your Own Arduino



    Project #1 Step by Step


    The first thing you need to do is set up power. With your breadboard and
    components in front of you… let’s get started!
    With this step, you will be setting the breadboard Arduino up for constant
    +5Volts power using a 7805 voltage regulator.


    Figure 1-2: Power setup with LED indicator.

    In order for the voltage regulator to work, you need to provide more than
    5V power. A typical 9V battery with a snap connector would work just
    fine for this.

    Power is going to come into the breadboard where you see the red and
    black + and – squares. Then add one of the 10uF capacitors. The longer
    leg is the Anode (Positive) and the shorter leg is the Cathode (Negative).
    Most capacitors are also marked with a stripe down the negative side.
    Across the empty space on the breadboard (the channel) you will need to
    place two hook-up wires for positive (red) and ground (black) to jump
    power from one side of the breadboard to the other.

    Now add the 7805 voltage regulator. The 7805 has three legs. If you are
    looking at it from the front, the left leg is for voltage in (Vin) the middle leg
    is for ground (GND) and the third leg is for voltage out (Vout). Make sure
    the left leg is lined up with your positive power in, and the second pin to
    ground.


    Coming out of the voltage regulator and going to the power rail on the
    side of the breadboard you need to add a GND wire to the ground rail and
    then the Vout wire (3rd leg of the voltage regulator) to the positive rail.
    Add the second 10uF capacitor to the power rail. Paying attention to the
    Positive and Negative sides.

    It’s a good idea to include an LED status indicator which can be used for
    troubleshooting. To do this you need to connect the right side power rail
    with the left power rail. Add positive to positive and negative to negative
    wires at the bottom of your breadboard.



    Figure 1-3: Left and Right Power Rail Connections.

    Having power on the left and right power rail will also help to keep your
    breadboard organized when providing power to the various components.
    Figure 1-4: For the LED status indicator, connect
    a 220Ω resistor (colored as: red, red, brown)
    from power to the anode of the LED (positive
    side, longer leg) and then a GND wire to the
    cathode side.

    Congratulations, now your breadboard is set up for +5V power. You can
    move onto the next step in the circuit design.

    Now we want to prepare the ATmega168 or 328 chip. Before we begin,
    let’s take a look at what each pin on the chip does in relationship to the
    Arduino functions. NOTE: The ATmega328 runs pretty much the same
    speed, with same pinout, but features more than twice the flash memory
    (30k vs 14k) and twice the EEPROM (1Kb vs 512b).


    Figure 1-5: Arduino Pin Mapping
    The ATmega168 chip is created by Atmel. If you look up the datasheet
    you won’t find that the above references are the same. This is because
    the Arduino has its own functions for these pins, and I have provided
    them only on this illustration. If you would like to compare or need to
    know the actual references for the chip, you can download a copy of the
    datasheet at www.atmel.com. Now that you know the layout of the pins,
    we can start hooking up the rest of the components.

    To start, we will build the supporting circuitry for one side of the chip and
    then move on to the other side. Pin one on most chips has an identifier
    marker. Looking at the ATmega168 or 328 you will notice a u-shaped
    notch at the top as well as a small dot. The small dot indicates that this is
    pin 1.


    Figure 1-6: Supporting circuitry pins 15-28

    From the GND power bus, add a jumper wire to pin 22. Next, from the
    positive power bus, add jumper wires to pin 20 (AVCC - Supply voltage
    for the ADC converter. Needs to be connected to power if ADC isn't being
    used and to power via a low-pass filter if it is (a low pass filter is a circuit
    that cleans out noise from the power source, we aren't using one)
    Then add a jumper wire from the positive bus to pin 21 (Analog reference
    pin for ADC).

    On the Arduino, pin 13 is the LED pin. Note that on the actual chip the
    pin is number 19. When uploading your sketch code and for all projects
    you will still reference this as Pin 13.

    To hook up the LED, add a 220Ω resistor from GND to the cathode of the
    LED. Then from the anode of the LED add a jumper wire to pin 19.
    Now we can move onto the other side of the chip. You are almost
    finished!




    Figure 1-6: Supporting circuitry pins 1-14

    Above the ATmega168 chip near the pin 1 identifier, place the small tact
    switch. This switch is used for resetting the Arduino. Right before you
    upload a new sketch to the chip you will want to press this once. Now
    add a small jumper wire from pin 1 to the bottom leg of the switch then
    add the 10K resistor from power to the pin 1 row on the breadboard.
    Finally add a GND jumper wire to the top leg of the switch.

    Add power and GND jumpers to pin 7(VCC) and pin 8 (GND). Add the
    16MHz clock crystal to pin 9 and 10 and then the two .22pF capacitors
    from pins 9 and 10 to GND. (See note below for alternative method).
    Your basic breadboard arduino is now complete. You could stop right
    here if you wanted to and swap an already programmed chip from your
    Arduino board to the breadboard, but since you came this far, you might
    as well finish off by adding some programming pins. This will allow you to
    program the chip from the breadboard.

    NOTE: Instead of using the 16MHz clock crystal, you can use a 16 MHz
    ceramic resonator with built-in capacitors, three-terminal SIP package.
    You will have to arrange your breadboard a little differently, the resonator
    has three legs. The middle leg will go to ground and the other two legs
    will go to pins 9 & 10 on the ATmega168 chip.

    Referring to Figure 1-6, locate a spot where you have 6 columns on the
    breadboard that are not in contact with anything else. Place a row of six
    male header pins here.

    With the breadboard facing you, the connections are as follows:
    GND, NC, 5V, TX, RX, NC, I am also calling these pins 1,2,3,4,5,6. From
    your power bus rail, add the GND wire to pin 1 and a wire from power for
    pin 3. NC means not connected, but you can connect these to GND if
    you want to.

    From pin 2 on the ATmega168 chip, which is the Arduino RX pin, you will
    connect a wire to pin 4 (TX) of your programming headers. On the
    ATmega168 chip, pin 3 Arduino TX gets connected to pin 5 (RX) on your
    header pins.

    The communication looks like this: ATmega168 RX to Header Pin TX,
    and ATmega168 TX to Header Pin RX.
    Now you can program your breadboard Arduino.




      Programming Options

    The first option is to buy a TTL-232R 3.3V USB – TTL Level Serial Cable.
    These can be purchased at www.adafruit.com or www.ftdichip.com
    The other two options, which I prefer are to buy one of two breakout
    boards from SparkFun.com. They are:

     FT232RL USB to Serial Breakout Board, SKU: BOB-0071 (This
    option takes up more space on your breadboard)

     FTDI Basic Breakout - 3.3V SKU: DEV-08772 (This option, and
    using right angle male headers works the best out of all three
    because it is secured better on the breadboard)

    Build Your Own Arduino


    Project #1 Programming the ATmega168 chip

    Double check your connections, make sure your 9V battery is not
    connected and hook up your programming option. Open up the Arduino
    IDE and in the Example sketch files, under Digital, load the Blink sketch.
    Under the file option Serial Port, select the COM port that you are using
    with your USB cable. i.e. COM1, COM9, etc.

    Under the file option Tools/Board, select either:

     Arduino Duemilanove w/ATmega328

     Arduino Decimila, Duemilanove or Nano w/ATmega128

    (depending on which chip you are using with your breadboard Arduino)
    Now press the upload icon and then hit the reset button on your
    breadboard. If you are using one of the SparkFun breakout boards, you
    will see the RX and TX lights blink. This lets you know that the data is
    being sent. Sometimes you need to wait a few seconds after pressing the
    upload button before pressing the reset switch. If you have trouble, just
    experiment a little with how fast you go between the two.
    This sketch if uploaded properly will blink the LED on pin 13 on for one
    second, off for one second, on for one second… until you either upload a
    new sketch or turn off the power.

    Once you have uploaded the code, you can disconnect the programming
    board and use your 9V battery for power.

    Troubleshooting


     No Power – Make sure your source power is above 5V.
     Power but nothing works – recheck all your connection points.
     Uploading error – Refer to www.arduino.cc and do a search on the

    particular error message you receive. Also check the forums as
    there is a lot of great help there.

    The Six Pack Abs Workout and Diet Plan

    The Six Pack Abs Workout and Diet Plan

    Use this workout plan every other day

    Warm-up Circuit
    Complete this warm-up circuit two times, resting 30 seconds between circuits.
    Y-Squat( 10 REPS)
    Pushup( 10 REPS)
    Stick-Up( 10 REPS)
    Mountain Climber( 5 REPS PER SIDE)
    Forward Lunge( 5 REPS PER LEG)
    Waiter’sBow( 10 REPS)
    Spiderman Climb(ALTERNATE LEGS UNTIL YOU DO 5 REPS PER SIDE)



    WORKOUT A SUPERSETS


    (Superset 1)
    Perform these two exercises back-to-back, no rest between. Rest 1 minute before repeating the superset two more times.
    ShoulderPress Pushup(10 REPS)


    Place your feet on a bench and hands on the floor slightly wider than shoulder-width. Pike your hips up in the air, so you are
    as vertical as can be. Slowly lower your head to the floor. Pause, and push with your shoulders and triceps back to the start
    position. Do 10 reps.

    Step-Up(12 REPS perleg)

    The step should be high enough that your thigh is parallel to the floor when your foot is on the step. Place one foot on the
    step and push down through your heel to lift your other leg up. Return to the starting position and finish all reps with one leg
    before switching legs and repeating the exercise. Do 12 reps per leg.

    (Superset 2)

    Perform these two exercises back-to-back, no rest between. Rest 1 minute before repeating the superset two more times.
    1-LegRDL (8 REPS leg)

    Stand with your feet slightly more than shoulder-width apart. Raise one foot and extend it behind you, just off the floor.
    Contract your glutes, brace your abs, and keep your spine naturally arched. Focusing on balance, lower yourself until your
    torso is parallel to the floor. Initiate the movement by pushing your hips back. Push back up to the starting position. Do 8
    reps per leg.


    SwissBallMountain Climber(10 REPS side)
    Assume the classic pushup position but place your hands on the sides of a Swiss ball, fingers pointing forward. Brace your
    abs and straighten your legs behind you. This is the starting position. Lift one foot off the floor and bring your knee toward
    your chest. Straighten your leg back out, move your other knee to your chest, and return that leg to the starting position.
    Keep alternating sides. Do 10 reps per side.



    (Superset 3)

    Perform these two exercises back-to-back, no rest between. Rest 1 minute before repeating the superset one more time.

    Inverted Row(12 REPS)
    Set a bar at hip height in a Smith machine or squat rack. Lie underneath the bar with your heels on the floor and grab the
    bar, your hands 1 or 2 inches more than shoulder-width apart. Keeping your body in a straight line, pull your chest up to the
    bar using your back muscles. Slowly lower yourself until your arms are straight. Do 12 reps.
    Wide-GripPushup(20 REPS)
    Do this as you would a standard pushup, but place your hands wider apart. Do 20 reps.


    INTERVAL WORKOUT

    Warm up for 3 minutes, getting progressively more intense with time.
    Perform an interval by exercising for 30 seconds at a very hard pace (at a subjective 8/10 level of effort).
    Follow that with “active rest” for 30 seconds by exercising at a slow pace (at a subjective 3/10 level of effort).

    Repeat for a total of 6 intervals.
    Finish with 4 minutes of very low intensity (3/10) exercise for a cool-down.
    MinutebyMinute Type IntensityLevel

    You don't want to count calories, look up recipes, or think about your weight-loss program. You want it
    to be easy, you want it to be filling, and you want it to work.



    Meal Plan


    Pick a breakfast, a 10:30 a.m. snack, a lunch, a 3:00 p.m. snack, and a dinner from the list below.


    Breakfast


    Pick one:
    - Bowl of cereal: 1.5 cups (2 servings) Shredded Wheat or Wheaties with 6 oz. 1 percent milk
    - Bowl of oatmeal: 1 cup instant oatmeal, unsweetened, with 20 blueberries
    - 3 scrambled eggs
    Add
    - 1 piece of fruit: A medium apple, banana, or orange
    - Breakfast beverage: An 8 oz. glass of unsweetened orange juice, 1 percent milk, or a pint of coffee
    (that's a grande) with 1 sugar and 1 individual packet of cream. (Save yourself 27 calories by
    substituting calorie-free sweetener and a drop of skim milk.)


    Lunch


    Pick one:
    - Turkey sandwich: 3 deli slices of turkey breast on whole-wheat bread with lettuce, tomato, and 1 tsp.
    Dijon mustard
    - Tuna sandwich: 1 can tuna, drained, mixed with 3 tsp. Dijon mustard on whole-wheat bread
    - PB&J sandwich: Peanut butter and easy-on-the-jelly on whole-wheat bread
    Add
    - 1 piece of fruit
    - Handful of almonds: 24-28 nuts
    - Water


    Dinner


    Pick one:
    - Seared steak: 1 medium New York strip steak, seared (click here to learn how)
    - Chicken breast: Boneless, skinless chicken breast, grilled (George Foreman or otherwise) with 1 tsp.
    BBQ sauce
    Add
    - 1 heaping portion green vegetables: An individual frozen package or normal-sized can of peas, green
    beans, or spinach
    - 1 glass wine or beer: A 6 oz. glass of wine or a bottle of beer. Don't go nuts, here: Extra calories from
    alcohol can ruin your weight-loss plans


    Snacks


    At 10:30 a.m. and 3 p.m., pick one of these snacks:
    - Stonyfield fruit-flavored yogurt
    - 2 sticks low-fat string cheese


    Don't Want to Cook?


    For those of you who are too lazy to make it yourself.
    If you must eat out for breakfast…
    McDonald’s: Egg McMuffin, no hash browns, Breakfast beverage
    Burger King: Croissan’wich egg and cheese, no side, Breakfast beverage
    If you must eat out for lunch…
    McDonald’s: Option 1: Asian Salad with Grilled Chicken and Newman’s Own Low-fat 
    Sesame Ginger


    Dressing


    McDonald’s: Option 2: 6-piece Chicken McNuggets with 1 package BBQ sauce
    Burger King: Option 1: Whopper Jr. (no mayo) with side garden salad
    Burger King: Option 2: Tendergrill Chicken Garden Salad with Ken’s Light Italian Dressing
    Wendy’s: Ultimate Chicken Grill Sandwich with side salad and medium iced tea


    If you must eat out for dinner…


    McDonald’s: Option 1: Asian Salad with Grilled Chicken and Newman’s Own Low-fat Sesame Ginger
    Dressing
    McDonald’s: Option 2: 6-piece Chicken McNuggets with 1 package BBQ sauce
    Burger King: Option 1: Whopper Jr. (no mayo) with side garden salad
    Burger King: Option 2: Tendergrill Chicken Garden Salad with Ken’s Light Italian Dressing
    Wendy’s: Ultimate Chicken Grill Sandwich with side salad and medium iced tea


    If you’d rather microwave…


    Healthy Choice: Beef Merlot Dinner
    Lean Cuisine: Glazed Chicken
    How you can get six pack abs faster
    So far I've given you a basic diet and some exercises to follow, but if you want to develop six pack abs
    more quickly, you'll have to use a more advanced workout plan. And that's not all. You'll need a good
    diet regimen to go with your new workout routine as well.



    For a full workout routine and diet program, I recommend reading The Truth About Six Pack Abs .
    To get it Click Here.

    Tuesday, 27 August 2013

    ARDUINO (Controlling the Direction and Speed of a Brushed Motorwith an H-Bridge)

    ARDUINO (Controlling the Direction and Speed of a Brushed Motorwith an H-Bridge)


    Problem


    You want to control the direction and speed of a brushed motor. This extends the
    functionality controlling both motor direction and speed through
    commands from the serial port.

    Solution

    Connect a brushed motor to the output pins of the H-Bridge as shown in Figure
    Controlling the Direction and Speed of a Brushed Motorwith an H-Bridge

    Controlling the Direction and Speed of a Brushed Motor with an H-Bridge



    . Connecting a brushed motor using analogWrite for speed control

    This sketch uses commands from the Serial Monitor to control the speed and direction
    of the motor. Sending 0 will stop the motor, and the digits 1 through 9 will control the
    speed. Sending “+” and “-” will set the motor direction:
    /*
    * Brushed_H_Bridge sketch
    * commands from serial port control motor speed and direction
    * digits '0' through '9' are valid where '0' is off, '9' is max speed
    * + or - set the direction
    */
    const int enPin = 5; // H-Bridge enable pin
     Controlling the Direction and Speed of a Brushed Motor with an H-Bridge
    const int in1Pin = 7; // H-Bridge input pins
    const int in2Pin = 4;
    void setup()
    {
    Serial.begin(9600);
    pinMode(in1Pin, OUTPUT);
    pinMode(in2Pin, OUTPUT);
    Serial.println("Speed (0-9) or + - to set direction");
    }
    void loop()
    {
    if ( Serial.available()) {
    char ch = Serial.read();
    if(isDigit(ch)) // is ch a number?
    {
    int speed = map(ch, '0', '9', 0, 255);
    analogWrite(enPin, speed);
    Serial.println(speed);
    }
    else if (ch == '+')
    {
    Serial.println("CW");
    digitalWrite(in1Pin,LOW);
    digitalWrite(in2Pin,HIGH);
    }
    else if (ch == '-')
    {
    Serial.println("CCW");
    digitalWrite(in1Pin,HIGH);
    digitalWrite(in2Pin,LOW);
    }
    else
    {
    Serial.print("Unexpected character ");
    Serial.println(ch);
    }
    }
    }

    Discussion
    This recipe is similar  in which motor direction is controlled by the levels
    on the IN1 and IN2 pins. But in addition, speed is controlled by the analogWrite value
    on the EN pin . Writing a value of 0 will stop the
    motor; writing 255 will run the motor at full speed. The motor speed will vary in proportion
    to values within this range.



     Using Sensors to Control the Direction and Speed of
    Brushed Motors (L293 H-Bridge)

    Problem
    You want to control the direction and speed of brushed motors with feedback from
    sensors. For example, you want two photo sensors to control motor speed and direction
    to cause a robot to move toward a beam of light.


    Solution

    This Solution uses similar motor connections to those shown in Figure , but with
    the addition of two light-dependent resistors, as shown in Figure
    Figure . Two motors controlled using sensors
    The sketch monitors the light level on the sensors and drives the motors to steer toward
    the sensor detecting the brighter light level:
    /*
    * Brushed_H_Bridge_Direction sketch
    * uses photo sensors to control motor direction
    * robot moves in the direction of a light
    */
    int leftPins[] = {5,7,4}; // on pin for PWM, two pins for motor direction
    int rightPins[] = {6,3,2};
    8.11 Using Sensors to Control the Direction and Speed of Brushed Motors (L293 H-Bridge) | 311
    const int MIN_PWM = 64; // this can range from 0 to MAX_PWM;
    const int MAX_PWM = 128; // this can range from around 50 to 255;
    const int leftSensorPin = 0; // analog pins with sensors
    const int rightSensorPin = 1;
    int sensorThreshold = 0; // must have this much light on a sensor to move
    void setup()
    {
    for(int i=1; i < 3; i++)
    {
    pinMode(leftPins[i], OUTPUT);
    pinMode(rightPins[i], OUTPUT);
    }
    }
    void loop()
    {
    int leftVal = analogRead(leftSensorPin);
    int rightVal = analogRead(rightSensorPin);
    if(sensorThreshold == 0){ // have the sensors been calibrated ?
    // if not, calibrate sensors to something above the ambient average
    sensorThreshold = ((leftVal + rightVal) / 2) + 100 ;
    }
    if( leftVal > sensorThreshold || rightVal > sensorThreshold)
    {
    // if there is adequate light to move ahead
    setSpeed(rightPins, map(rightVal,0,1023, MIN_PWM, MAX_PWM));
    setSpeed(leftPins, map(leftVal ,0,1023, MIN_PWM, MAX_PWM));
    }
    }
    void setSpeed(int pins[], int speed )
    {
    if(speed < 0)
    {
    digitalWrite(pins[1],HIGH);
    digitalWrite(pins[2],LOW);
    speed = -speed;
    }
    else
    {
    digitalWrite(pins[1],LOW);
    digitalWrite(pins[2],HIGH);
    }
    analogWrite(pins[0], speed);
    }
    Discussion

    This sketch controls the speed of two motors in response to the amount of light detected
    by two photocells. The photocells are arranged so that an increase in light on one side
    will increase the speed of the motor on the other side. This causes the robot to turn
    toward the side with the brighter light. Light shining equally on both cells makes the
    robot move forward in a straight line. Insufficient light causes the robot to stop.
    Light is sensed through analog inputs 0 and 1 using analogRead. When
    the program starts, the ambient light is measured and this threshold is used to determine
    the minimum light level needed to move the robot. A margin of 100 is added to the
    average level of the two sensors so the robot won’t move for small changes in ambient
    light level. Light level as measured with analogRead is converted into a PWM value using
    the map function. Set MIN_PWM to the approximate value that enables your robot to move
    (low values will not provide sufficient torque; find this through trial and error with your
    robot). Set MAX_PWM to a value (up to 255) to determine the fastest speed you want the
    robot to move.
    Motor speed is controlled in the setSpeed function. Two pins are used to control the
    direction for each motor, with another pin to control speed. The pin numbers are held
    in the leftPins and rightPins arrays. The first pin in each array is the speed pin; the
    other two pins are for direction.
    An alternative to the L293 is the Toshiba FB6612FNG. This can be used in any of the
    recipes showing the L293D. Figure 8-13 shows the wiring for the FB6612 as used on
    the Pololu breakout board (SparkFun ROB-09402).
    Figure. H-Bridge wiring for the Pololu breakout board

     Using Sensors to Control the Direction and Speed of Brushed Motors (L293 H-Bridge) 

    You can reduce the number of pins needed by adding additional hardware to control
    the direction pins. This is done by using only one pin per motor for direction, with a
    transistor or logic gate to invert the level on the other H-Bridge input. You can find
    circuit diagrams for this in the Arduino wiki, but if you want something already wired
    up, you can use an H-Bridge shield such as the Freeduino motor control shield (NKC
    Electronics ARD-0015) or the Ardumoto from SparkFun (DEV-09213). These shields
    plug directly into Arduino and only require connections to the motor power supply
    and windings.
    Here is the sketch revised for the Ardumoto shield:
    /*
    * Brushed_H_Bridge_Direction sketch for Ardumotor shield
    * uses photo sensors to control motor direction
    * robot moves in the direction of a light
    */
    int leftPins[] = {10,12}; // one pin for PWM, one pin for motor direction
    int rightPins[] = {11,13};
    const int MIN_PWM = 64; // this can range from 0 to MAX_PWM;
    const int MAX_PWM = 128; // this can range from around 50 to 255;
    const int leftSensorPin = 0; // analog pins with sensors
    const int rightSensorPin = 1;
    int sensorThreshold = 0; // must have this much light on a sensor to move
    void setup()
    {
    pinMode(leftPins[1], OUTPUT);
    pinMode(rightPins[1], OUTPUT);
    }
    void loop()
    {
    int leftVal = analogRead(leftSensorPin);
    int rightVal = analogRead(rightSensorPin);
    if(sensorThreshold == 0){ // have the sensors been calibrated ?
    // if not, calibrate sensors to something above the ambient average
    sensorThreshold = ((leftVal + rightVal) / 2) + 100 ;
    }
    if( leftVal > sensorThreshold || rightVal > sensorThreshold)
    {
    // if there is adequate light to move ahead
    setSpeed(rightPins, map(rightVal,0,1023, MIN_PWM, MAX_PWM));
    setSpeed(leftPins, map(leftVal, 0,1023, MIN_PWM, MAX_PWM));
    }
    }
    void setSpeed(int pins[], int speed )
    {
    if(speed < 0)
    {
    digitalWrite(pins[1],HIGH);
    speed = -speed;
    }
    else
    {
    digitalWrite(pins[1],LOW);
    }
    analogWrite(pins[0], speed);
    }
    The loop function is identical to the preceding sketch. setSpeed has less code because
    hardware on the shield allows a single pin to control motor direction.
    The pin assignments for the Freeduino shield are as follows:
    int leftPins[] = {10,13}; // PWM, Direction
    int rightPins[] = {9,12}; // PWM, Direction
    Here is the same functionality implemented using the Adafruit Motor Shield; see Figure
    8-14. This uses a library named AFMotor that can be downloaded from the Adafruit
    website.
    Figure. Using the Adafruit Motor Shield
    adafruit motor shield
    adafruit motor shield

    The Adafruit shield supports four connections for motor windings; the sketch that
    follows has the motors connected to connectors 3 and 4:
    /*
    * Brushed_H_Bridge_Direction sketch for Adafruit Motor shield
    * uses photo sensors to control motor direction
    * robot moves in the direction of a light
    */
    #include "AFMotor.h" // adafruit motor shield library
     Using Sensors to Control the Direction and Speed of Brushed Motors (L293 H-Bridge)
    AF_DCMotor leftMotor(3, MOTOR12_1KHZ); // motor #3, 1 KHz pwm uses pin 5
    AF_DCMotor rightMotor(4, MOTOR12_1KHZ); // motor #4, 1 KHz pwm uses pin 6
    const int MIN_PWM = 64; // this can range from 0 to MAX_PWM;
    const int MAX_PWM = 128; // this can range from around 50 to 255;
    const int leftSensorPin = 0; // analog pins with sensors
    const int rightSensorPin = 1;
    int sensorThreshold = 0; // must be more light than this on sensors to move
    void setup()
    {
    }
    void loop()
    {
    int leftVal = analogRead(leftSensorPin);
    int rightVal = analogRead(rightSensorPin);
    if(sensorThreshold == 0){ // have the sensors been calibrated ?
    // if not, calibrate sensors to something above the ambient average
    sensorThreshold = ((leftVal + rightVal) / 2) + 100 ;
    }
    if( leftVal > sensorThreshold || rightVal > sensorThreshold)
    {
    // if there is adequate light to move ahead
    setSpeed(rightMotor, map(rightVal,0,1023, MIN_PWM, MAX_PWM));
    setSpeed(leftMotor, map(leftVal ,0,1023, MIN_PWM, MAX_PWM));
    }
    }
    void setSpeed(AF_DCMotor &motor, int speed )
    {
    if(speed < 0)
    {
    motor.run(BACKWARD);
    speed = -speed;
    }
    else
    {
    motor.run(FORWARD);
    }
    motor.setSpeed(speed);
    }
    If you have a different shield than the ones mentioned above, you will need to refer to
    the data sheet and make sure the values in the sketch match the pins used for PWM
    and direction.



    follow and check this link too 

    Monday, 26 August 2013

    Decision Making in C (The real power of a mc)

    The real power of a mc is its ability to read data and take action(s) based on that data. Stated differently, a mc has the ability to make decisions based on the information provided to it. In this chapter, you will learn
    the various expressions that enable your program to make decisions based on the state of some set of data.
    Relational Operators
    As you might guess, a decision is often based on comparing the state of two or more pieces of data. You
    make such decisions all the time, probably without thinking much about the process that is involved in making the decision. The phone rings and you get up to answer it. Implicitly, you make a decision whether to answer the call or not. Further, that decision involved comparing the expected benefits from answering
    the call
    (e.g., it might be someone you want to talk with) versus the expected costs of not answering the
    call (i.e., I may miss out on talking to someone important).
    Some decisions are better than others. Indeed,
    the definition of a dilemma is when you have two or more choices and they are all bad.
    Table 4-1 presents the relational operators available to you in Arduino C. All of the operators in the
    table are binary operators and require two operands.
    Table 4-1.
    Relational Operators
    Operator Interpretation
    > Greater than
    >= Greater than or equal to
    < Less than
    <= Less than or equal to
    == Equal to
    != Not equal to

    The result of all relational operations is either logic true (non-zero) or logic false (zero).
    For example:
    5 > 4 // Logic true
    5 < 4 // logic false
    5 == 4 // logic false
    5 != 4 // logic true

    Clearly, you can also use variables in the expressions.
    If a = 5 and b = 4, then:

    a > b // Logic true
    a < b // logic false
    a == b // logic false
    a != b // logic true

    These expressions are exactly the same as the previous set, only we substituted variables for the
    numeric constants. Now let’s see how to use the relational operators with some C statements.
    The if Statement
    In a computer program, unless the central processing unit (CPU) is told to do otherwise, the CPU
    processes the source code program instructions in a linear, top-to-bottom manner. That is, program
    execution starts at whatever is designated as the starting point for the program and plows through the
    source code from that point to the next statement until all of the statements have been processed.
    In an Arduino C program, the starting point for the program is the function named setup(). The
    program processes all of the statements in the setup() function block starting with the first statement and
    marches through the statements from statement 1 to statement 2 to statement 3...until it reaches the
    closing parentheses of the setup() function block. You can, however, alter this linear processing flow by
    using an if statement.
    The syntax for an if statement is:
    if (expression1 is logic true) {
    // execute this if statement block if true
    }
    // statements following the if statement block
    An if statement consists of the if keyword followed by a set of opening and closing parentheses.
    Within those parentheses is an expression that evaluates to either logic true or logic false. After the closing
    parenthesis of the if test is an opening brace character ({). The opening brace is followed by one or more
    program statements that are to be executed if the if test is logic true. Almost every programmer on the
    planet indents these statements one tab stop. (I use the smallest number of spaces for the indent. You can
    change the indent size by using the Edit menu and clicking the Increase Indent or Decrease Indent option.
    A smaller indent decreases the need for horizontal scrolling.) The if block statements are then followed
    by a closing brace (}), which marks the end of the if statement block.
    Consider the following code fragment:
    int b = 10;
    // some more program statement...
    if (b < 20) {
    b = doSomethingNeat();
    }
    doSomethingElse(b);
    The code fragment begins by defining b and initializing it to 10. Then some unspecified statements are
    executed followed by an if test. If b has remained unchanged by the unknown statements, its value is still
    10. Because b is less than 20, the expression is logic true, the if statement block is executed, and function
    doSomethingNeat() is called and its return value is assigned into b. Then the statement following the if
    statement block is executed, and doSomethingElse(b) is called.
    the if test is false, then the if statement block is skipped and the call to doSomethingNeat()is not
    made. Therefore, after the (false) test, the next statement to be executed is doSomethingElse(b).
    You can
    see the path of program execution more clearly in Figure 4-1. A logic true result of the relational test causes program flow to execute the statement(s) in the if statement block. If the relational test result is logic false, then the if statement block is skipped and the program resumes execution at the first statement following
    the closing brace of the if statement block. As you can see, a decision has been made in the program
    based on the program’s data.
    false
    . . . . . .
    . . . . . .
    }
    {
    true
    if (relational test)
    statements
    statements
    Figure 4-1. Execution Paths for if Test.
    Note that the relational test (expression1) expects a true or false result. In this case, however, we used
    a single equal sign for the relational expression rather than the proper “is equal to” operator (==). This
    means the code performs an assignment statement, not a relational test. This is what I call a Flat Forehead
    Mistake (FFM). You know, the kind of mistake where you slam the heel of your hand into your forehead
    while muttering: “How could I make such a stupid mistake!” Relax. All good programmers have a slightly
    flattened forehead and you should expect your fair share of such hammerings. The good news is that
    although you might make a FFM mistake a second time, you will find the error more quickly the second
    time. Anytime you end up in an if statement’s statement block when you know you shouldn’t be there,
    check for this type of error. It is pretty easy to forget the second equal sign character.
    If the if statement block consists of a single program statement, then the braces defining the
    statement block may be omitted. For example:
    if (b == 10)
    b = doSomethingNeat();
    doSomethingElse();
    works exactly the same as it did before. If the two versions behave the same, then why the extra keystrokes?
    There are several reasons why you should always use braces for if statement blocks. First, always using
    braces adds consistency to your coding style, and that’s always a good thing. Second, adding the braces
    delineates the if statement and makes it stand out more while you are reading the code. Finally, although
    you may think only one statement is needed right now, subsequent testing and debugging may show you
    need to add another statement to the if (b == 10)
    b = doSomethingNeat();
    doBackupNow();
    doSomethingElse();
    Although the programmer wanted to call both doSomethingNeat() and doBackupNow() only when b
    equals 10, the way the code is written the call to doBackupNow() is always called, because what the
    programmer actually has written is:
    if (b == 10) {
    b = doSomethingNeat();
    }
    doBackupNow();
    doSomethingElse();
    Always remember that, without braces, the if statement block default to a single statement being
    controlled by the if test.
    Arduino is a open source IDE it gives the best out of your mind and great tool in making your inovation

    Sunday, 25 August 2013

    Best workout schedule for getting RIPPED

    Best workout schedule for getting RIPPED

    Getting RIPPED and getting big are different things.getting ripped is to have low body fat level from 6-7% of total body weight .now people are more attracted towards having a ripped  body .
    steps to get RIPPED body Fast :

    step 1: 

    Avoid food with high fat content and high carbs.
    most people think all type of carbs are bad but it is not true .complex carbs. like brown bread ,brown rice ,etc are good for body and they make you feel full for long and to save you from cravings .


    step 2:

    your diet plan plays a major role in getting ripped about 40% of work is done in kitchen only .so without a healthy diet you cant hit your goal .


    step 3:

    follow a workout schedule as follows
    1 chest /triceps
    2 back /biceps
    3 legs/shoulder

    try to hit this schedule 6 days a week and to lift moderate weight with high no. of raps
    BLACK Coffee
    having black coffee before the workout can affect your fat loss rate .coffee contains antioxidants which help burning stored fat


    CARDIO:-

    regular cardio exercises are must
    cardio like bicycle ,running, jogging ,stepping are good .But best is to have HIIT(high intensity interval training )

    HACK TATA DOCOMO 3G INTERNET UPTO7.5Mbps FREE 100% WORKING TRICK

    HACK TATA DOCOMO 3G INTERNET UPTO7.5Mbps FREE 100% WORKING TRICK
     A 3g enabled handset also use 2g handset


    Step 1)  FIRST Download ( PD PROXY CLIENT)  software hear

    Step 2) Create an Account for pd proxy from Here



    (If you create a free account ,
    you can only use 100mb data usage per day...better  get         
    premium account so that you can enjoy unlimited 3G. Don't worry its not so costly,,it costs
    only about 2.8$ per month.........)


    Step 3) Open PD proxy and run as administrator.Give your user name and password in the respective fields



    Step 4) connect your mobile or dongle to the pc using the accespoint (tatadocomo3g)
              If you have use this trick for 2g network using the accesspoint (tata.docomo.internet)


    Step 5) conect internet form mobile pc suite or you have use dongle then connect.



    Step 6) Enter your username or password In pd proxy.





    Step 6)click conect button in PD Proxy Then enjoy Free internet upto 7.5 mbps.


    PLZ HIT LIKE IF IT HELPED
    IF YOU FACE ANY KIND OF PROBLEM PLZ COMMENT AND I WOULD LOVE TO RESOLVE YOUR PROBLEM........

    How to earn money online

    How to earn money online 

    As there are million of ptc sites available on internet now .

     But beaware of scam sites u can be a victim of it very easily . They can make u fool by false promises of earning thousand in one month etc ..
    how to choose a ptc site ..

    1  First cross check the sites you are going to join or register .
        you can do this by simply searching on Google for   ex. (example + scam )  

    2  Then make a plan how to go for it .
        you simply cannot become rich in one day it takes time to set the things goning on .
    3  Stick to your goal   because getting bored of it is very easy and you will probably get rid of it
    4  Follow these points and you xan earn a lot just from your home .

         

    My personal recommended sites are :-

    Sunday, 4 August 2013

    PTC (pay to click)

    PAY TO CLICK sites are new way to earn sitting home .
    you may see lot of adds that show pics of theri check they recived from the ptc site they use .
    can we get the views on this .


    IS IT REALLY POSSIBLE TO EARN EASILY OR  WE ARE JUST HELPING THEM TO EARN .?

    also list some good sites if you know any :-