First the schematic and breadboard image!
* If anyone notices an error in the schematic please inform me, I might have done it wrong when look at the actual physical breadboard and transferring it to fritzing.
schem2.PNG 57.03KB 217 downloads
schem.PNG 59.6KB 203 downloads
Code!
Option Strict Off Imports Microsoft.SPOT Imports Microsoft.SPOT.Hardware Imports SecretLabs.NETMF.Hardware Imports SecretLabs.NETMF.Hardware.Netduino Module Module1 Sub Main() Dim led1 As PWM = New PWM(Pins.GPIO_PIN_D5) Dim led2 As PWM = New PWM(Pins.GPIO_PIN_D6) Dim led3 As PWM = New PWM(Pins.GPIO_PIN_D9) Dim led4 As PWM = New PWM(Pins.GPIO_PIN_D10) Dim lightSensor0 As AnalogInput = New AnalogInput(Pins.GPIO_PIN_A0) Dim lightSensor1 As AnalogInput = New AnalogInput(Pins.GPIO_PIN_A1) Dim val1 As Integer = 0 Dim val2 As Integer = 0 lightSensor0.SetRange(0, 50) lightSensor1.SetRange(0, 50) Do While True val1 = lightSensor0.Read() val2 = lightSensor1.Read() led1.SetDutyCycle(val1) led2.SetDutyCycle(val2) led3.SetDutyCycle(val1 + val2) led4.SetDutyCycle(val1 * val2) Loop End Sub End Module
Hope that helps the VB users out. Feel free to ask any questions.