Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
int analogPin = 3;
void setup()
{
Serial.begin(9600);
}
void loop()
{
int val = analogRead(analogPin);
Serial.println(val);
}
int ledPin = 9;
int analogPin = 3;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
int val = analogRead(analogPin);
analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
}
int analogRead(int pin)
10-bit ADC so returns values between 0 and 1023
Each unit equals 5V / 1024 = 0.0049V per unit
e.g. a value of 200 units would equal 0.98 or ~1V
int myInts[6];
int myPins[] = {2, 4, 8, 3, 6};
int mySensVals[6] = {2, 4, -8, 3, 2};
char message[6] = "hello";
One read takes ~100 microseconds, or 0.0001 seconds
int x = myPins[1];
myPins[1] = 5;
myPins = [ 0, 5, 2, 3, 4 ]
Result = [ 0, 5, 2, 3, 4 ]
So x now contains 5
struct color {
byte red;
byte green;
byte blue;
};
struct color myColor = { 255, 255, 255 };
void analogWrite(int pin, byte value)
Most pins ~490 Hz
char Str1[15];
char Str2[8] = {'a', 'r', 'd', 'u', 'i', 'n', 'o'};
char Str3[8] = {'a', 'r', 'd', 'u', 'i', 'n', 'o', '\0'};
char Str4[ ] = "arduino";
char Str5[8] = "arduino";
char Str6[15] = "arduino";
Pins 5 and 6 are ~980 Hz
myColor.red = 128;
myColor.green = 0;
myColor.blue = 0;
byte red = myColor.red;
byte green = myColor.green;
byte blue = myColor.blue;
http://arduino.cc/en/Tutorial/Tone
http://arduino.cc/en/Tutorial/Tone2
http://arduino.cc/en/Tutorial/Knock
http://www.cutedigi.com/arduino/sensors-kit-for-arduino.html