Class VBBMicro

java.lang.Object
virtualbreadboard.vbbmicro.target.VBBMicro
Direct Known Subclasses:
Arduino

public class VBBMicro extends Object
VBBMicro is a programmable test probe for virtual breadboard circuits

The VBBMicro can be used to drive automated tests using familiar Arduino IO via pins or by querying and controlling VBB Component widgets.

The VBB Unit Test framework is supported when using the JUnit style assert() and @Test and @Before bindings.

   
 
 import virtualbreadboard.vbbmicro.target.VBBMicroUNO;
 import virtualbreadboard.cdk.widget.ButtonWidget;
 
 public class TestApp extends VBBMicroUNO{
 
@Before
 void preTest(){
      // Code executed before each test
 }
 
@Test
 void testOneThing(){
      // Code executed before each test
      assertTrue(false);//fail first!
 }
 
@Test
 void testAnotherThing(){
      // Code executed before each test
      assertTrue(false);//fail first!
 }
 
 }
 
 
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    analogRead(int pin)
     
    void
    analogWrite(int pin, int value)
     
    void
    assertTrue(boolean value)
    Injects test result into the Unit Test framework.
    void
    assertTrue(String message, boolean value)
     
    void
    delay(int milliseconds)
     
    void
    delay(long milliseconds)
     
    static int
    digitalRead(int pin)
    Reads the value from a specified digital pin, either HIGH or LOW.
    void
    digitalWrite(int pin, boolean value)
     
    void
    digitalWrite(int pin, int value)
    Write a HIGH or a LOW value to a digital pin.
    Queries the Breadboard for the VBBComponent of the Id
    Queries the Breadboard to bind a named net.
    void
    Processing/Arduino 'loop' method.
    long
     
    void
    pinMode(int pin, int mode)
    Configures the specified pin to behave either as an input or an output.
    void
    Processing/Arduino 'setup' method.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • VBBMicro

      public VBBMicro()
  • Method Details

    • loop

      public void loop()
      Processing/Arduino 'loop' method. Override to execute repeatedly.
    • setup

      public void setup()
      Processing/Arduino 'setup' method. Override to execute once on startup.
    • delay

      public void delay(long milliseconds)
    • delay

      public void delay(int milliseconds)
    • pinMode

      public void pinMode(int pin, int mode)
      Configures the specified pin to behave either as an input or an output.
      Parameters:
      pin - the number of the pin whose mode you wish to set
      mode - INPUT or OUTPUT
    • digitalWrite

      public void digitalWrite(int pin, int value)
      Write a HIGH or a LOW value to a digital pin. If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the Vdd (Typically 5V or 3.3V ) for HIGH, 0V (ground) for LOW.
      Parameters:
      pin - the pin number to write to
      value - HIGH or LOW
    • digitalWrite

      public void digitalWrite(int pin, boolean value)
    • analogRead

      public int analogRead(int pin)
    • analogWrite

      public void analogWrite(int pin, int value)
    • digitalRead

      public static int digitalRead(int pin)
      Reads the value from a specified digital pin, either HIGH or LOW.
      Parameters:
      The - pin to read
      Returns:
      HIGH or LOW
    • millis

      public long millis()
    • assertTrue

      public void assertTrue(boolean value)
      Injects test result into the Unit Test framework.
      Parameters:
      value - the result of a condition
    • assertTrue

      public void assertTrue(String message, boolean value)
    • getComponent

      public VBBComponent getComponent(String Id)
      Queries the Breadboard for the VBBComponent of the Id
    • getNamedNet

      public VoltageNet getNamedNet(String netName)
      Queries the Breadboard to bind a named net.