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 int
static final int
static final int
static final boolean
static final boolean
static final int
Fields inherited from class virtualbreadboard.vbbmicro.target.VBBMicro
ANALOG_OUTPUT, HIGH, INPUT, INPUT_PULLUP, LOW, OUTPUT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
abs
(int a) long
abs
(long a) void
analogWriteFrequency
(int pin, int frequency) double
atan
(double x) float
atan
(float x) double
atan2
(double y, double x) float
atan2
(float y, float x) binary
(int val) binary
(int val, int places) binary
(long val) binary
(long val, int places) int
bit
(int x, int bit) int
bit
(long x, int bit) int
bitClear
(int x, int bit) int
bitClear
(long x, int bit) int
bitRead
(int a, int bit) int
bitRead
(long a, int bit) int
bitSet
(int x, int bit) int
bitSet
(long x, int bit) int
constrain
(int x, int a, int b) double
cos
(double x) float
cos
(float x) double
exp
(double exponent) float
exp
(float exponent) byte
highByte
(int x) byte
highByte
(long x) boolean
isAlpha
(int c) boolean
isAlphaNumeric
(int c) boolean
isAscii
(int c) boolean
isControl
(int c) boolean
isDigit
(int c) boolean
isGraph
(int c) boolean
isHexadecimalDigit
(int c) boolean
isLowerCase
(int c) boolean
isPrintable
(int c) boolean
isPunct
(int c) 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').boolean
isUpperCase
(int c) boolean
isWhitespace
(int c) double
log
(double exponent) float
log
(float exponent) byte
lowByte
(int x) Bitwisebyte
lowByte
(long x) int
map
(int value, int fromLow, int fromHigh, int toLow, int toHigh) int
max
(int a, int b) long
max
(long a, long b) int
min
(int a, int b) long
min
(long a, long b) void
noTone()
void
noTone
(int pin) double
pow
(double base_Renamed, double exponent) float
pow
(float base_Renamed, float exponent) long
pulseIn
(int pin, int pulse) Reads a pulse (either HIGH or LOW) on a pin.int
random
(int max) int
random
(int min, int max) long
random
(long max) long
random
(long min, long max) setCharAt is a String helper function to support the Arduino getCharAt operator.void
shiftOut
(int pinDAT, int pinCLK, boolean msb, int data) Shifts out a byte of data one bit at a time.double
sin
(double x) float
sin
(float x) double
sqrt
(double x) float
sqrt
(float x) float
sqrt
(int x) float
sqrt
(long x) String()
String
(char v) String
(int val, int format) String
(long v) String
(long val, int format) double
tan
(double x) float
tan
(float x) int
long
int
toLowerCase
(int c) void
tone
(int pin, int frequency) void
tone
(int pin, int frequency, long durationMillis) toString
(int value) toString
(long value) int
toUpperCase
(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)
-