Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Coding Smackdown's Content

There have been 72 items by Coding Smackdown (Search limited from 22-May 23)


By content type

See this member's


Sort by                Order  

#30842 Wireless RGB lamp

Posted by Coding Smackdown on 18 June 2012 - 07:34 PM in Project Showcase

Nice idea!



#21442 Speech Synthesis

Posted by Coding Smackdown on 07 December 2011 - 12:43 PM in General Discussion

Actually if you do some searching on the web you might be able to find an old version of code that allows you to play back phonemes together to make speech. I did it way back in the 80s on a timex sinclair 1000 and it was better than the mechanical sounding chip processors.



#29903 Thermistor help need

Posted by Coding Smackdown on 29 May 2012 - 03:21 AM in General Discussion

I've been working on an Electric Brew System Controller that I used to replace the controller in a Cajun Injector Electric Turkey Fryer. I've been using a TMP36 sensor along with the built in thermistor that is built into the heating element. I water proofed the TMP36 sensor by using a 1 foot length of 1/4 OD copper tubing and a 1/4 copper cap. I used Marine Epoxy on both ends to help keep the water out. I really did not notice that big of a lag in the thermistor compared to the TMP36 sensor. They both seemed to be pretty accurate side by side once I figured out the proper coefficients for the Stein-Hart Calculations. I also found a simpler version of the Stein-Hart Calculation over at http://thermistor.sourceforge.net/ that might cut down on the CPU a bit. There is also a nice little program that will calculate the coefficients based on a series of resistance and temperature measurements in case you can't find a part number or coefficients for a thermistor you might be using. I know it helped me out quite a bit since the manufacturer does provide enough detail about the parts used to put together their unit. If you are interested in the source for the controller you can find the source at https://github.com/l...TempController. Currently it is for a Netduino Plus, but I'll more than likely be converting it over to a Gadgeteer device soon, since things are getting pretty cramped.



#21130 Boost Application Memory by 10-15%

Posted by Coding Smackdown on 29 November 2011 - 10:26 PM in Netduino Plus 2 (and Netduino Plus 1)

Valkyrie-MT, I applied your change and got another couple of KBytes back on my app. It really helps to be able to squeeze memory from different places when you are trying to shoe horn in a lot of functionality in an app. Thanks!



#21233 General Listing of Netduino Resources

Posted by Coding Smackdown on 01 December 2011 - 08:48 PM in General Discussion

I've amassed about 50+ sites that have .NET MF related blog posts, code, and circuits. They are not all Netduino related, but I use them day to day in my development. My list is a lot like Pete Brown's geek list, I'll spend some time breaking them out into various categories and update the Wiki with them. Thanks Guys!



#31065 The best calculation between 2 times

Posted by Coding Smackdown on 22 June 2012 - 12:21 PM in Visual Basic Support

Have you tried using DateTime.Subtract? This returns a TimeSpan object that has both values that can then be used. Cheers



#35503 Netduino Mini Firmware v4.2.0

Posted by Coding Smackdown on 18 September 2012 - 10:28 PM in Netduino Mini

Hi. I successfully updated my netduino, but I've tried twice now to update my mini following the directions, and everything seems to go fine, but at the end I have an unresponsive board. I'm using the 232 firmware and at the end of the process I can't ping it using mfdeploy ("No response from device"). I tried switching to TTL interface and giving it an escape command in a terminal and I also don't get a response. Is there something wrong with the 232 firmware image, or any suggestions on how I might troubleshoot a problem on my end?

Thanks,
MR


Yep, there is an issue with the 232 firmware. The ETA for an update should be coming up within the next day or two. For now, you'll have to use the TTL firmware.

Good Luck!



#35512 Adafruit 20x2 Character VFD (Vacuum Fluorescent Display) - SPI interface - 20...

Posted by Coding Smackdown on 19 September 2012 - 12:44 AM in General Discussion

I picked up an Adafruit 20x2 Character VFD (Vacuum Fluorescent Display) - SPI interface - 20T202DA2JA

http://www.adafruit.com/products/347

I was hoping to use it an one of my controller projects. I based my driver off of the MicroLiquidCrystal Shifter74Hc595LcdTransferProvider and the LCD class. I made changes based on the datasheets, but I'm having to send data and commands twice in order to get the controller to recognize what I'm sending.

I'm thinking maybe my SPI configuration is setup incorrectly, but I haven't been able to find too much about how to configure the SPI port.

I've included the code below, in case anyone can figure it out.

Thanks!

using System;
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;

//
// SPI Vacum Flouresent Display Driver
// Based on the SPI_VFD Arduino Library
// Created by AdaFruit
//
namespace CodingSmackdown.Drivers
{
// When the display powers up, it is configured as follows:
//
// 1. Display clear
// 2. Function set:
// N = 1; 2-line display
// BR1=BR0=0; (100% brightness)
// 3. Display on/off control:
// D = 0; Display off
// C = 0; Cursor off
// B = 0; Blinking off
// 4. Entry mode set:
// I/D = 1; Increment by 1
// S = 0; No shift
//
// Note, however, that resetting the Arduino doesn't reset the LCD, so we
// can't assume that its in that state when a sketch starts (and the
// SPI_VFD constructor is called).
public class SPI_VFDisplay : IDisposable
{
// commands
private const byte VFD_CLEARDISPLAY = 0x01;
private const byte VFD_RETURNHOME = 0x00;
private const byte VFD_ENTRYMODESET = 0x04;
private const byte VFD_DISPLAYCONTROL = 0x08;
private const byte VFD_CURSORSHIFT = 0x10;
private const byte VFD_FUNCTIONSET = 0x30;
private const byte VFD_SETCGRAMADDR = 0x40;
private const byte VFD_SETDDRAMADDR = 0x80;

// flags for display entry mode
private const byte VFD_ENTRYRIGHT = 0x00;
private const byte VFD_ENTRYLEFT = 0x02;
private const byte VFD_ENTRYSHIFTINCREMENT = 0x01;
private const byte VFD_ENTRYSHIFTDECREMENT = 0x00;

// flags for display on/off control
private const byte VFD_DISPLAYON = 0x04;
private const byte VFD_DISPLAYOFF = 0x00;
private const byte VFD_CURSORON = 0x02;
private const byte VFD_CURSOROFF = 0x00;
private const byte VFD_BLINKON = 0x01;
private const byte VFD_BLINKOFF = 0x00;

// flags for display/cursor shift
private const byte VFD_DISPLAYMOVE = 0x08;
private const byte VFD_CURSORMOVE = 0x00;
private const byte VFD_MOVERIGHT = 0x04;
private const byte VFD_MOVELEFT = 0x00;

// flags for function set
private const byte VFD_2LINE = 0x08;
private const byte VFD_1LINE = 0x00;

private const byte VFD_SPICOMMAND = 0xF8;
private const byte VFD_SPIDATA = 0xFA;

private byte _linemode;
private byte _brightness;
private byte _displaycontrol;
private byte _shiftmode;
private byte _incrementmode;
private byte _displaymode;
private byte _cursormode;
private byte _blinkmode;

private byte _initialized;

private byte _numlines;
private byte _currline;

private readonly SPI _spi;
private readonly OutputPort _latchPort;
readonly byte[] _writeBuf = new byte[1];

public enum Brightness
{
VFD_BRIGHTNESS25 = 0x03,
VFD_BRIGHTNESS50 = 0x02,
VFD_BRIGHTNESS75 = 0x01,
VFD_BRIGHTNESS100 = 0x00
}

public SPI_VFDisplay(SPI.SPI_module spiBus, Cpu.Pin latchPin, Brightness brightness)
{
var spiConfig = new SPI.Configuration(
Cpu.Pin.GPIO_NONE, //latchPin,
false, // active state
0, // setup time
0, // hold time
false, // clock idle state
true, // clock edge
1000, // clock rate
spiBus);

_spi = new SPI(spiConfig);

_latchPort = new OutputPort(latchPin, true);

//default to 2x20 display (SAMSUNG 20T202DA2JA)
begin(20, 2, brightness);
}

public void begin(byte columns, byte lines, Brightness brightness)
{
// set number of lines
if (lines > 1)
_linemode = VFD_2LINE;
else
_linemode = VFD_1LINE;
// save off for address translation
_numlines = lines;

// turn the display on with no cursor or blinking default
_displaycontrol = VFD_DISPLAYON;
_cursormode = VFD_CURSORON;
_blinkmode = VFD_BLINKOFF;
_shiftmode = VFD_ENTRYLEFT;
_incrementmode = VFD_ENTRYSHIFTDECREMENT;
// init the display
display();

//catch bad values
if (brightness > Brightness.VFD_BRIGHTNESS25)
_brightness = (byte)Brightness.VFD_BRIGHTNESS100;
else
_brightness = (byte)brightness;
// set the brightness and push the linecount with VFD_SETFUNCTION
setBrightness(brightness);

// set cursor shift for romance lnaguages
leftToRight();

// clear the display
clear();
// set starting address to column 0, row 0
home();
}

public void setBrightness(Brightness brightness)
{
// set the brightness (only if a valid value is passed
if (brightness <= Brightness.VFD_BRIGHTNESS25)
{
_brightness = (byte)brightness;

command((byte)(VFD_FUNCTIONSET | _brightness | _linemode));
}
}

public byte getBrightness()
{
// get the brightness
return (byte)(_brightness);
}

public void clear()
{
command(VFD_CLEARDISPLAY); // clear display, set cursor position to zero
}

public void home()
{
command(VFD_SETDDRAMADDR | 0x00); // set cursor position to zero
}

public void setCursor(byte col, byte row)
{
int[] row_offsets = { 0x00, 0x40, 0x14, 0x54 };

if (row > _numlines)
{
row = (byte)(_numlines - 1); // we count rows starting w/0
}
// we only have 20 columns even though there are 40 cols addressable
if (col > 20)
{
col = 20;
}

int address = col + row_offsets[row];

command((byte)(VFD_SETDDRAMADDR | address));
}

// Turn the display on/off (quickly)
public void noDisplay()
{
_displaycontrol = VFD_DISPLAYOFF;
command((byte)(VFD_DISPLAYCONTROL | _displaycontrol | _cursormode | _blinkmode));
}

public void display()
{
_displaycontrol = VFD_DISPLAYON;
command((byte)(VFD_DISPLAYCONTROL | _displaycontrol | _cursormode | _blinkmode));
}

// Turns the underline cursor on/off
public void noCursor()
{
_cursormode = VFD_CURSOROFF;
command((byte)(VFD_DISPLAYCONTROL | _displaycontrol | _cursormode | _blinkmode));
}

public void cursor()
{
_cursormode = VFD_CURSORON;
command((byte)(VFD_DISPLAYCONTROL | _displaycontrol | _cursormode | _blinkmode));
}

// Turn on and off the blinking cursor
public void noBlink()
{
_blinkmode = VFD_BLINKOFF;
command((byte)(VFD_DISPLAYCONTROL | _displaycontrol | _cursormode | _blinkmode));
}

public void blink()
{
_blinkmode = VFD_BLINKON;
command((byte)(VFD_DISPLAYCONTROL | _displaycontrol | _cursormode | _blinkmode));
}

// These commands scroll the display without changing the RAM
public void scrollDisplayLeft()
{
command((byte)(VFD_CURSORSHIFT | VFD_DISPLAYMOVE | VFD_MOVELEFT));
}

public void scrollDisplayRight()
{
command((byte)(VFD_CURSORSHIFT | VFD_DISPLAYMOVE | VFD_MOVERIGHT));
}

// This is for text that flows Left to Right
public void leftToRight()
{
_shiftmode = VFD_ENTRYLEFT;
command((byte)(VFD_ENTRYMODESET | _shiftmode | _incrementmode));
}

// This is for text that flows Right to Left
public void rightToLeft()
{
_shiftmode = VFD_ENTRYRIGHT;
command((byte)(VFD_ENTRYMODESET | _shiftmode | _incrementmode));
}

// This will 'right justify' text from the cursor
public void autoscroll()
{
_incrementmode = VFD_ENTRYSHIFTINCREMENT;
command((byte)(VFD_ENTRYMODESET | _shiftmode | _incrementmode));
}

// This will 'left justify' text from the cursor
public void noAutoscroll()
{
_incrementmode = VFD_ENTRYSHIFTDECREMENT;
command((byte)(VFD_ENTRYMODESET | _shiftmode | _incrementmode));
}

// Allows us to fill the first 8 CGRAM locations
// with custom characters
public void createChar(byte location, byte[] charmap)
{
location &= 0x7; // we only have 8 locations 0-7
command((byte)(VFD_SETCGRAMADDR | (location << 3)));
for (int i = 0; i < 8; i++)
{
write(charmap[i]);
}
}

// spool string data to the display
public void print(string data)
{
byte[] output = System.Text.Encoding.UTF8.GetBytes(data);
for (int i = 0; i < output.Length; i++)
{
write(output[i]);
}
}

/*********** mid level commands, for sending data/cmds, init */

private void command(byte value)
{
_latchPort.Write(false);

_writeBuf[0] = VFD_SPICOMMAND;
_spi.Write(_writeBuf);
_writeBuf[0] = value;
_spi.Write(_writeBuf);

_latchPort.Write(true);

Thread.Sleep(1);

_latchPort.Write(false);

_writeBuf[0] = VFD_SPICOMMAND;
_spi.Write(_writeBuf);
_writeBuf[0] = value;
_spi.Write(_writeBuf);

_latchPort.Write(true);

Thread.Sleep(1);
}

private void write(byte value)
{
_latchPort.Write(false);

_writeBuf[0] = VFD_SPIDATA;
_spi.Write(_writeBuf);
_writeBuf[0] = value;
_spi.Write(_writeBuf);

_latchPort.Write(true);

Thread.Sleep(1);

_latchPort.Write(false);

_writeBuf[0] = VFD_SPIDATA;
_spi.Write(_writeBuf);
_writeBuf[0] = value;
_spi.Write(_writeBuf);

_latchPort.Write(true);

Thread.Sleep(1);
}

public void Dispose()
{
_spi.Dispose();
_latchPort.Dispose();
}
}
}



#36761 Adafruit 20x2 Character VFD (Vacuum Fluorescent Display) - SPI interface - 20...

Posted by Coding Smackdown on 08 October 2012 - 07:50 AM in General Discussion

Kem, I like how you've made the SPI write calls a more compact. I was thinking that maybe I needed to add some time between the writes in order to get the device to understand the commands. The only thing I can think of is that the first time through we are writing to the CG Buffer and the second time we are writing to the Data Buffer which gets displayed. I'm still a bit lost on why we have to write it out two times. Nothing in the documentation give a clue. I've got a second one on the way and this time I'll put a data analyzer on it to see what is going on. Cheers



#35125 Beerbrew Controller

Posted by Coding Smackdown on 13 September 2012 - 02:10 PM in General Discussion

BTW: I have a project out on GitHub that covers my Brew Controller for a modified Electric Turkey Fryer, that runs on a Netduino Plus that has both a physical user itnerface, (LCD and Buttons), as well as a web based UI. It is based on my DIY Brewery TempLogger Project out at http://diybrewery.com You can find the code on GitHub at https://github.com/l...yTempController Hope it helps you get started!



#37333 2D navigation using Triliteration

Posted by Coding Smackdown on 17 October 2012 - 06:23 PM in General Discussion

If you are planning to just keep the robot within your back yard I would think you could get away with just using a beacon style system. Ben Heck did this in one of his episodes out on element14.com where he used a couple of XBees and Ultrasonic Devices to create a Call and Ping configuration to allow his automated luggage to follow the user. The XBee on the luggage would send out a request and the target would then reply with a ultrasonic ping which would then let the Arduino calculate the distance and direction of the target. I'm pretty sure you could set up some type of similar system that would allow the robot to navigate your backyard. Since the Xbee has a short range you would probably need multiple stations to cover a good sized back yard. I'm interested to see what you come up with. Good Luck!



#37744 Internet Printing (IPP) from Netduino

Posted by Coding Smackdown on 22 October 2012 - 02:31 AM in General Discussion

About a year back I wrote some basic code to print on network receipt printers. The biggest issue I had was all of the example code was too big for the Netduino. I end up sending basic text and ASCII commands to the printer, but never got what I was looking for. Now With .Net 4.2 you might have enough memory to do it. Its double almost since last time i tried. Good luck!



#31097 Need Help with LCD Display Board

Posted by Coding Smackdown on 22 June 2012 - 06:07 PM in General Discussion

I recently have been putting together a replacement controller for an Electric Turkey Fryer. I had everything working just perfectly with all of the circuits on a breadboard and had even brewed 5 batch of beer with the entire setup. I had created two circuit boards to put in an enclosure with the Netduino, one was a shield that held all of the power conversion, relay driver and button connections, the other was a daughter board that attaches to a 16 x 2 LCD Display using the same circuit in Simon's post over at http://geekswithblog...id_crystal.aspx I sent the board out to BatchPCB.com to be made and finally got them back. I spent a couple days assembling the boards and when I went to test everything my LCD Display is not working. At first I thought maybe my connector from the shield to the daughter board was messed up, but I checked it and I have connectivity to everything as expected along with +5V and Ground. What I am not seeing is +5V at the LCD Display, I'm only seeing +1.8V. At first I thought there was a short some place, but I cannot find anything wrong. I went back to re-wiring the daughter board on the breadboard and now I'm getting the same results coming off the shield. It looks as if the signals to drive the 595 chip are not coming across. The connector I'm using is about 6 inches in length, which was about the same length as the jumpers I used when originally wired up the circuit. What I'm seeing now is a bunch of garbage on the display and a lot of strange flashing and the back light going on and off as the Netduino sends data to the display. I've attached pictures of the schematics and pc boards for you to take a look at in hopes someone can spot my issue. The boards are double sided with the red traces on the top and the blue traces on the bottom. Hopefully someone can point me in the right direction. Thanks

Attached Thumbnails

  • Main_Board_Schematic.png
  • Main_Shield_Board.png
  • LCD_Display_Schematic.png
  • LCD_Display Board.png



#35119 Beerbrew Controller

Posted by Coding Smackdown on 13 September 2012 - 01:30 PM in General Discussion

The Netduino will handle what you are looking for as far as inputs and outputs. The biggest issue I've ran across is memory. To do a lot of what you want to do, requires a lot of code and even under .Net 4.2 you are limited to around 64Kb of code on the Netduino Plus which makes things cramped. You'll need to probably start off with some of the libraries out in the community and cut them down to just what you'll need and jettison all of the extra stuff that you don't to get everything on the Netduino Plus. I'll be interested in how things go. I always love seeing someone using off the shelf items to build out their brewery. Good Luck



#36594 Converting existing programs from 4.1 to 4.2

Posted by Coding Smackdown on 05 October 2012 - 08:53 PM in Visual Studio

Have you made sure that the assemblies your program is referencing have been built for .Net 4.2? I know that if you use some of the libraries directly from the web sites, they have not been compiled for .Net 4.2 and you will see that error when you try to deploy them to your Netduino. I tend to add the source code to my solution and then I know that all of the libraries have been compiled for whatever version of .Net my device is running. Good Luck.



#30215 tpa81 i2c sensor read error with net cable connected

Posted by Coding Smackdown on 05 June 2012 - 05:29 AM in Netduino Plus 2 (and Netduino Plus 1)

One of the forums members did a pretty exhaustive test around ADC noise and that is probably what you are seeing. You can find his write up at http://highfieldtale...se-of-netduino/ Hope this helps.



#35718 Netduino Plus Built in Sketch

Posted by Coding Smackdown on 21 September 2012 - 04:51 PM in General Discussion

There is nothing to worry about. The devices only come with the latest firmware at the time of manufacture which does not include a diagnostic program. I usually end up flashing with the latest firmware as soon as I get a new device just to make sure it is on the same revision of firmware that I'm currently using. Cheers!



#35076 Documentation

Posted by Coding Smackdown on 12 September 2012 - 09:33 PM in General Discussion

If you are just starting out check out "Getting Started with Netduino" by Chris Walker http://www.amazon.co...ywords=Netduino and "Getting Started with the Internet of Things: Connecting Sensors and Microcontrollers to the Cloud" by Cuno Pfister http://www.amazon.co...micro framework If you want a little more detail about the .Net Micro Framework check out "Expert .NET Micro Framework" by Jens Kühner http://www.amazon.co...micro framework Another good example about .Net Micro Framework devices that includes code examples for the Netduino is "Professional's Guide To .NET Micro Framework Application Development" by Sean D. Liming and John R. Malin http://www.amazon.co...micro framework Otherwise, the best examples you are going to find are right here in the forums. I don't think there is nothing that hasn't been covered or discussed in one way or another. Good Luck!



#21000 simple put to localhost confusing

Posted by Coding Smackdown on 26 November 2011 - 02:27 PM in Netduino Plus 2 (and Netduino Plus 1)

You have to remember that a web server will only answer requests on the port that you configure it for. If you only have the server configured to listen on the default port which is port 80 then your request will fail on port 8080. To get the web server to respond on port 8080 you need to configure the web server to listen on other ports. If you double check the Apache docs, they should show you how to configure the web server to listen on additional ports. Otherwise, just don't try the request on port 8080.



#21278 How to set a static ip address?

Posted by Coding Smackdown on 03 December 2011 - 12:27 AM in Netduino Plus 2 (and Netduino Plus 1)

If you are wanting to do it from within your program check out this post It talks about the NetworkInterface Class that allows you to manipulative the network settings on the Netduino Plus. http://forums.netdui...uration-options I'm getting ready to update my Temperature Logger to provide full network address configuration from within my web-base GUI. Once I finish the updates I'll post back here so you have an example.



#35984 Websockets on Netduino Plus

Posted by Coding Smackdown on 25 September 2012 - 07:10 PM in General Discussion

Welcome to the forums! I've done something similar that might be a good starting point for you. I'm using a Netduino Plus to control an electric brewing system via a web interface. You can find the source code out on GitHub - https://github.com/l...yTempController you want to look specifically at the CodingSmackdown.ControllerInterface project which requires Visual Studio Web Express and I think ASP.MVC 3 Library to open. The other project you want to look at is the CodingSmackdown.TemperatureController project which hosts a web server based on the NeonMika.NETMF.Webserver library along witha couple of custom modules to respond to commands and return data. If you build the web interface using responsive design, you should be able to create something that will work not only an Android, but any type of device with a browser that supports JavaScript. Hope this gets you moving forward!



#30214 Brewing Beer with a Netduino Plus

Posted by Coding Smackdown on 05 June 2012 - 05:13 AM in Project Showcase

I've been working on a new brewing project and have gotten far enough along to start showing it off to folks. I've been working on modifying an Electric Turkey Fryer that I can use to brew small batch of beer for competitions and such. I based the temperature control off of my previous DIY Brewery Temperature Monitor project and enhanced it to allow the user to enter in a temperature that the Netduino will work to maintain during the mashing process. I've also added buttons to control the system for those times when I don't have a network handy along with a LCD Display to show the current status of the system. I'm still waiting for the circuit boards to come back from BatchPCB.com so I can assemble the system in a nice control panel. You can read about it over at my DIY Brewery Blog at http://diybrewery.com




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.