while (true) { irValue = irSensor.Read(); irValue = irValue / 5; if (irValue > 100) irValue = 100; pwm.SetDutyCycle((uint)irValue); }I also added a safeguard so that the value doesn't get bigger than 100 (100 is full-on for pwm).
- Netduino Forums
- → Stefan W.'s Content
Stefan W.'s Content
There have been 153 items by Stefan W. (Search limited from 14-May 23)
#27556 Assign Analog input value to PWM output
Posted by Stefan W. on 18 April 2012 - 03:49 PM in Netduino 2 (and Netduino 1)
#27445 Electronics 101 book recommendation
Posted by Stefan W. on 17 April 2012 - 09:10 AM in General Discussion
#27085 hardware quirk and bugs
Posted by Stefan W. on 12 April 2012 - 06:26 PM in Netduino 2 (and Netduino 1)
#27071 hardware quirk and bugs
Posted by Stefan W. on 12 April 2012 - 03:41 PM in Netduino 2 (and Netduino 1)
#27060 hardware quirk and bugs
Posted by Stefan W. on 12 April 2012 - 01:13 PM in Netduino 2 (and Netduino 1)
On start up, only pin 3 and pin 7 fire high,
and pin 3 looks like its only 50 percent, but only happens for like 5
seconds. Then the program starts. It looks like a hardware quirk.
IIRC, on startup the microcontroller uses all pins as input with pullup enabled, then, after the startup-routine (bootloader and so on) is finished, the program starts ... so what's in your code will not take effect immediately after boot.
#26857 Analog Input Quirk
Posted by Stefan W. on 10 April 2012 - 11:54 AM in Netduino 2 (and Netduino 1)
#26367 Redacted 00101100
Posted by Stefan W. on 04 April 2012 - 09:54 AM in General Discussion
#26142 AnalogInput Repeatability
Posted by Stefan W. on 30 March 2012 - 08:35 AM in Netduino 2 (and Netduino 1)
It's a major shame that the 3.3V is so bouncy. When I hook my meter up to the 3.3V supply on the board it looks stable (this is using the Neetduino's 3.3v regulator), but I don't have the ability to see changes of short duration.
Yes, to see power supply noise you need an oscilloscope, not a multimeter. And the values you see now are "normal" - the last bits of the measurement are usually "noise".
#26040 Powering the Netduino via another Shield
Posted by Stefan W. on 28 March 2012 - 09:51 AM in Netduino Plus 2 (and Netduino Plus 1)
#26020 What's going on with the >= operator?
Posted by Stefan W. on 27 March 2012 - 04:49 PM in Netduino Plus 2 (and Netduino Plus 1)
flying around ... leading to bugs like thisA double is a double... They all have the same precision
#25908 Is it possible to power on/off the 3V3 pin?
Posted by Stefan W. on 23 March 2012 - 07:11 PM in General Discussion
#25705 Need some I2C help
Posted by Stefan W. on 19 March 2012 - 12:19 PM in General Discussion
#25093 Servo Jitters
Posted by Stefan W. on 05 March 2012 - 06:38 AM in General Discussion
#22441 Gyroscope Module L3G4200D help
Posted by Stefan W. on 04 January 2012 - 03:58 PM in Netduino 2 (and Netduino 1)
Please look in the specs of your gyro sensor if two transaction without stop-condition between them are needed.
Judging from the arduino sample code, it isn't needed.
#21890 Goodbye .NET MF?
Posted by Stefan W. on 20 December 2011 - 12:42 AM in Netduino 2 (and Netduino 1)
Hello Mario!
At first let me say thanks for presenting your clear view of the netduino. I'm conform with resolving complex requirements in managed code and sourcing the simple stuff out.
But I'm not really sure, if this is an economic way. Before adding a second unit for counting the pulses, I will try to write a driver. I found some tutorials in the net and I understand the technic.
Unless you are going for a large number of units, adding a chip is the economic way. You don't need an original/full arduino, for this an attiny should suffice, those cost you $2 with circuitry or something. Now, I don't know what your time is worth to you, but you'll need way more time changing the netduino firmware ...
Just one question left. Why adding a driver to the firmware for doing this work is not the recommend way? Are there technical problems or is it 'just' against the philosophy of netduino?
Best regards,
Frank
The above is the reason
#21738 Pinout Cards
Posted by Stefan W. on 15 December 2011 - 09:46 PM in General Discussion
#21543 Logging 2.5ms strain curves.
Posted by Stefan W. on 10 December 2011 - 01:30 PM in General Discussion
#21526 Logging 2.5ms strain curves.
Posted by Stefan W. on 09 December 2011 - 11:34 PM in General Discussion
#21406 Forum topics color
Posted by Stefan W. on 06 December 2011 - 08:41 PM in General Discussion
#21390 Forum topics color
Posted by Stefan W. on 06 December 2011 - 03:25 PM in General Discussion
#21020 Analog reading accuracy
Posted by Stefan W. on 27 November 2011 - 02:30 PM in General Discussion
#20880 Why does the SPI library only have WriteRead()?
Posted by Stefan W. on 23 November 2011 - 02:05 AM in Netduino 2 (and Netduino 1)
#20687 4-digit shield
Posted by Stefan W. on 16 November 2011 - 11:15 AM in General Discussion
#20670 4-digit shield
Posted by Stefan W. on 15 November 2011 - 09:51 PM in General Discussion
#20559 IO PIns state during reset or powerup
Posted by Stefan W. on 13 November 2011 - 11:22 PM in Netduino Plus 2 (and Netduino Plus 1)
o 3v3 | .-. | | | | 15k '-' | o-----o GPIO | .-. | | | | 2k2 '-' | o GND(if i remember the pullup value correctly) which will mean that you read about 0.42V at boot, which might not be logic low for everything. Also, in this setup, you waste ~1.5mA when you want to drive the pin high later ...
- Netduino Forums
- → Stefan W.'s Content
- Privacy Policy