Package virtualbreadboard.arduino
Class Arduino
java.lang.Object
virtualbreadboard.vbbmicro.target.VBBMicro
virtualbreadboard.arduino.Arduino
- Direct Known Subclasses:
ChatVBBUNO
The base Arduino functions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final booleanstatic final booleanstatic final intFields inherited from class virtualbreadboard.vbbmicro.target.VBBMicro
ANALOG_OUTPUT, HIGH, INPUT, INPUT_PULLUP, LOW, OUTPUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintabs(int a) longabs(long a) voidanalogWriteFrequency(int pin, int frequency) doubleatan(double x) floatatan(float x) doubleatan2(double y, double x) floatatan2(float y, float x) binary(int val) binary(int val, int places) binary(long val) binary(long val, int places) intbit(int x, int bit) intbit(long x, int bit) intbitClear(int x, int bit) intbitClear(long x, int bit) intbitRead(int a, int bit) intbitRead(long a, int bit) intbitSet(int x, int bit) intbitSet(long x, int bit) intconstrain(int x, int a, int b) doublecos(double x) floatcos(float x) doubleexp(double exponent) floatexp(float exponent) bytehighByte(int x) bytehighByte(long x) booleanisAlpha(int c) booleanisAlphaNumeric(int c) booleanisAscii(int c) booleanisControl(int c) booleanisDigit(int c) booleanisGraph(int c) booleanisHexadecimalDigit(int c) booleanisLowerCase(int c) booleanisPrintable(int c) booleanisPunct(int c) booleanisSpace(int c) Checks for white-space characters including space, formfeed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').booleanisUpperCase(int c) booleanisWhitespace(int c) doublelog(double exponent) floatlog(float exponent) bytelowByte(int x) BitwisebytelowByte(long x) intmap(int value, int fromLow, int fromHigh, int toLow, int toHigh) intmax(int a, int b) longmax(long a, long b) intmin(int a, int b) longmin(long a, long b) voidnoTone()voidnoTone(int pin) doublepow(double base_Renamed, double exponent) floatpow(float base_Renamed, float exponent) longpulseIn(int pin, int pulse) Reads a pulse (either HIGH or LOW) on a pin.intrandom(int max) intrandom(int min, int max) longrandom(long max) longrandom(long min, long max) setCharAt is a String helper function to support the Arduino getCharAt operator.voidshiftOut(int pinDAT, int pinCLK, boolean msb, int data) Shifts out a byte of data one bit at a time.doublesin(double x) floatsin(float x) doublesqrt(double x) floatsqrt(float x) floatsqrt(int x) floatsqrt(long x) String()String(char v) String(int val, int format) String(long v) String(long val, int format) doubletan(double x) floattan(float x) intlonginttoLowerCase(int c) voidtone(int pin, int frequency) voidtone(int pin, int frequency, long durationMillis) toString(int value) toString(long value) inttoUpperCase(int c) Methods inherited from class virtualbreadboard.vbbmicro.target.VBBMicro
analogRead, analogWrite, assertTrue, assertTrue, delay, delay, digitalRead, digitalWrite, digitalWrite, getComponent, getNamedNet, loop, millis, pinMode, setup
-
Field Details
-
BIN
public static final int BIN- See Also:
-
OCT
public static final int OCT- See Also:
-
DEC
public static final int DEC- See Also:
-
HEX
public static final int HEX- See Also:
-
MSBFIRST
public static final boolean MSBFIRST- See Also:
-
LSBFIRST
public static final boolean LSBFIRST- See Also:
-
Serial
-
-
Constructor Details
-
Arduino
public Arduino()
-
-
Method Details
-
map
public int map(int value, int fromLow, int fromHigh, int toLow, int toHigh) -
constrain
public int constrain(int x, int a, int b) -
min
public int min(int a, int b) -
min
public long min(long a, long b) -
isAlpha
public boolean isAlpha(int c) -
isDigit
public boolean isDigit(int c) -
isAlphaNumeric
public boolean isAlphaNumeric(int c) -
isWhitespace
public boolean isWhitespace(int c) -
isSpace
public boolean isSpace(int c) Checks for white-space characters including space, formfeed ('\f'), newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). -
isLowerCase
public boolean isLowerCase(int c) -
isUpperCase
public boolean isUpperCase(int c) -
toLowerCase
public int toLowerCase(int c) -
toUpperCase
public int toUpperCase(int c) -
isHexadecimalDigit
public boolean isHexadecimalDigit(int c) -
isAscii
public boolean isAscii(int c) -
isPunct
public boolean isPunct(int c) -
isPrintable
public boolean isPrintable(int c) -
isControl
public boolean isControl(int c) -
isGraph
public boolean isGraph(int c) -
setCharAt
setCharAt is a String helper function to support the Arduino getCharAt operator. In java strings are immutable - to change a character you need to make a new string.- Parameters:
str-pos-c-- Returns:
-
String
-
toInt
-
toLong
-
toString
-
toString
-
String
-
String
-
String
-
String
-
String
-
binary
-
binary
-
binary
-
binary
-
pulseIn
public long pulseIn(int pin, int pulse) Reads a pulse (either HIGH or LOW) on a pin. For example, if value of pulse is HIGH, pulseIn() waits for the pin to go HIGH, starts timing, then waits for the pin to go LOW and stops timing.- Parameters:
pin- The pin to measure the pulsepulse- Type of pulse, HIGH or LOW to read.- Returns:
- The length of the pulse in microseconds.
-
shiftOut
public void shiftOut(int pinDAT, int pinCLK, boolean msb, int data) Shifts out a byte of data one bit at a time. Starts from either the most (i.e. the leftmost) or least (rightmost) significant bit. Each bit is written in turn to a data pin, after which a clock pin is pulsed (taken high, then low) to indicate that the bit is available.- Parameters:
pinDAT- The pin onto which to shift the datapinCLK- The pin to toggle low to high to shift the datamsb- If true outputs msb and shifts left, else outputs lsb and shifts rightdata- The data byte to serialise on the shift pulses
-
tone
public void tone(int pin, int frequency) -
tone
public void tone(int pin, int frequency, long durationMillis) -
noTone
public void noTone(int pin) -
noTone
public void noTone() -
random
public int random(int min, int max) -
random
public int random(int max) -
random
public long random(long min, long max) -
random
public long random(long max) -
abs
public long abs(long a) -
max
public int max(int a, int b) -
max
public long max(long a, long b) -
exp
public double exp(double exponent) -
exp
public float exp(float exponent) -
log
public double log(double exponent) -
log
public float log(float exponent) -
pow
public double pow(double base_Renamed, double exponent) -
pow
public float pow(float base_Renamed, float exponent) -
sqrt
public double sqrt(double x) -
sqrt
public float sqrt(float x) -
sqrt
public float sqrt(long x) -
sqrt
public float sqrt(int x) -
sin
public float sin(float x) -
sin
public double sin(double x) -
cos
public float cos(float x) -
cos
public double cos(double x) -
tan
public float tan(float x) -
tan
public double tan(double x) -
atan
public float atan(float x) -
atan
public double atan(double x) -
atan2
public float atan2(float y, float x) -
atan2
public double atan2(double y, double x) -
lowByte
public byte lowByte(int x) Bitwise -
lowByte
public byte lowByte(long x) -
highByte
public byte highByte(int x) -
highByte
public byte highByte(long x) -
bitRead
public int bitRead(int a, int bit) -
bitRead
public int bitRead(long a, int bit) -
abs
public int abs(int a) -
bitSet
public int bitSet(int x, int bit) -
bitSet
public int bitSet(long x, int bit) -
bitClear
public int bitClear(int x, int bit) -
bitClear
public int bitClear(long x, int bit) -
bit
public int bit(int x, int bit) -
bit
public int bit(long x, int bit) -
analogWriteFrequency
public void analogWriteFrequency(int pin, int frequency)
-