- Netduino Forums
- → Mike P's Content
Mike P's Content
There have been 41 items by Mike P (Search limited from 05-May 23)
#17702 What is this called?
Posted by Mike P on 07 September 2011 - 01:42 AM in General Discussion
The decoupling cap serves to smooth out the power supply. It acts like a shock absorber on the supply voltage. Without it small spikes on the power supply would be created whenever loads were switched on and off and these spikes might be transfered to the output signal.
The spikes on the output could be mistaken for real output transitions and cause the encoder to lose its count.
I posted some code on the Wiki last night for a rotary encoder. Chances are that it would work fine with your strip as well.
http://wiki.netduino...oder-Input.ashx
#17567 What is this called?
Posted by Mike P on 05 September 2011 - 09:17 AM in General Discussion
#17521 Wiki tutorial on SPI
Posted by Mike P on 04 September 2011 - 12:31 PM in General Discussion
#17499 Wiki tutorial on SPI
Posted by Mike P on 04 September 2011 - 01:37 AM in General Discussion
#17286 Unable to deploy without disconnect\reconnect USB cable
Posted by Mike P on 30 August 2011 - 09:47 PM in Netduino Plus 2 (and Netduino Plus 1)
#17279 Six Button Interface for LCD Menu System.
Posted by Mike P on 30 August 2011 - 04:12 PM in General Discussion
#17235 Six Button Interface for LCD Menu System.
Posted by Mike P on 29 August 2011 - 01:37 PM in General Discussion
#17234 AD5206 Digi Pot with SPI code....?
Posted by Mike P on 29 August 2011 - 12:36 PM in General Discussion
#17085 Help with Proper Servo Driving
Posted by Mike P on 26 August 2011 - 09:09 AM in General Discussion
#16003 PWM demystified
Posted by Mike P on 28 July 2011 - 12:50 PM in Netduino 2 (and Netduino 1)
#15999 ADC value divide by 1024 or 1023
Posted by Mike P on 28 July 2011 - 12:26 PM in Netduino 2 (and Netduino 1)
#15995 Initializing Brushless Motor problem
Posted by Mike P on 28 July 2011 - 11:55 AM in Netduino 2 (and Netduino 1)
#15994 ADC value divide by 1024 or 1023
Posted by Mike P on 28 July 2011 - 11:35 AM in Netduino 2 (and Netduino 1)
#15914 Unable to deploy without disconnect\reconnect USB cable
Posted by Mike P on 26 July 2011 - 10:00 AM in Netduino Plus 2 (and Netduino Plus 1)
#15575 LCDKeypad 16x2 HD44780 Shield
Posted by Mike P on 17 July 2011 - 11:41 AM in Project Showcase
I've documented a simple mod to this DFRobot LCD Keypad Shield (DFR0009)
The mod gets the keypad working as intended.
http://forums.netdui...-keypad-shield/
I put the appropriate analog values into the code provided at the beginning of this thread.
The thresholds are chosen to be about mid way between one expected value and the next and are typically 90-100 counts from the expected values so it should be quite reliable.
/// <summary> /// Gets an enumeration of the key press at the current time. /// Can only be used if the LCD has been initialised with the true parameter. /// </summary> /// <returns></returns> public static Keys GetKey() { if (!analogInitialised) throw new Exception("Analog input is not Initialised"); int i = AnKey.Read(); if (i > 910)//expected value = 1024 return Keys.None; if (i < 90)//expected value = 0 return Keys.Right; if (i < 290)//expected value = 184 return Keys.Up; if (i < 490)//expected value = 397 return Keys.Down; if (i < 690)//expected value = 578 return Keys.Left; //expected value = 796 return Keys.Select; }
#15572 DFRobot LCD Keypad Shield
Posted by Mike P on 17 July 2011 - 10:52 AM in Project Showcase
This is my first contribution to the community so I hope someone finds it helpful.
I took the plunge and bought a Netduino plus from Little Bird in Australia.
I also bought the DFRobot LCD Keypad Shield at the same time so I would have something to display data on and some keys for control. I didn't select very carefully as it uses 8 pins to acheive this and there may have been better choices.
On the whole I am happy with it but because it is designed for Arduino it requires some modification for it to work with Netduino.
The module is the DFRobot DFR0009
http://www.dfrobot.c...t&product_id=51
For those not familiar with this shield it connects to a common 16x2 LCD module using a 4-bit interface. With enable and reset that brings the pin count to 6 pins for the LCD.
The backlight is driven by a 7th pin via a transistor. This is a PWM pin which simplifies adjusting backlight intensity.
So far so good.
The keypad is where the mod is required. It consists of 5 buttons labeled select, up, down, left,right.
The buttons tap into a string of resistors and pull the Analog input pin0 to different voltages depending on which button is pushed. The output is designed for Arduino so the analog levels for the buttons are spaced between 0 and 5v.
The voltage output when the left button is pressed and when no button is pressed is over 3.3v so it will register as 1024.
My first attempt to mod the shield was to pull out the 5v pin and bridge the Vcc to the 3.3V pin. This fixed the keypad OK but the LCD contrast was no good. The text was just readable with the contrast pot at one end of its range. The HD44780 can run on 3.3v but not this LCD module.
So I reversed that mod and looked for another way.
In the end I settled on removing the 2k resistor at the top of the chain that links between 5v and the analog pin0
The 2k resistor is an SMD chip resistor thet is located under the LCD module but it can easily be reached with a soldering iron.
Then I made a new connection with a 1500ohm resistor between 3.3v and the analog pin0.
The resistance change to 1500ohms helps to maintain the even separation of the voltages generated.
With the new setup the switch presses theoretically generate the following ADC values, mine were all within a few counts of these.
None=1024
Select=796
Left=578
Down=397
Up=184
Right=0
If you are coding the thresholds to check against are 90,290,490,690 and 910.
Check the sample code for Arduino to see how it's done.
Here are some photos that should make things clearer.
This one shows the "202" resistor to be removed
This shows where to add the 1500R resistor
This shows the picture from the DFRObot website. My unit looks different but it still functions the same.
The library I used was the microliquidcrystal library
The LCD provider settings are below
//Keypad connected to Analog pin 0 AnalogInput keys = new AnalogInput(Pins.GPIO_PIN_A0); //backlight connected to D10 // create the transfer provider // Initialize the library with the numbers of the interface pins PWM backlight = new PWM(Pins.GPIO_PIN_D10); var lcdProvider = new GpioLcdTransferProvider(Pins.GPIO_PIN_D8, Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D4, Pins.GPIO_PIN_D5, Pins.GPIO_PIN_D6, Pins.GPIO_PIN_D7);
- Netduino Forums
- → Mike P's Content
- Privacy Policy