Manual

www.nexusrobot.com Robot Kits manual
22
analogWrite(E1,100);
TCCR2B = TCCR2B & 0b11111000 | 0x01;
//set the timer1 as the work intrrupt timer
// to use the timer will defualt at the function of setup;
}
void loop() { }
The Motor sample to link wries
¾ Serial Port
This example shows you how to monitor the state of a switch by establishing serial communication
between your Arduino and your computer over USB.
Sample code
/*
DigitalReadSerial . Reads a digital input on pin 0, prints the result to the serial monitor
Use the example of gp2y0A21.to see how the Serial work.
*/
const int GP2Y0A21 = 0; //set analog pin 0 as the signal pin
int incomingByte = 0; // for incoming serial data
void setup()
{
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}