- Netduino Forums
- → smarcus3's Content
smarcus3's Content
There have been 134 items by smarcus3 (Search limited from 13-May 23)
#27930 Daisy Chain of Ic74HC595 can it control a LCD screen.
Posted by smarcus3 on 23 April 2012 - 06:41 AM in General Discussion
#27928 Daisy Chain of Ic74HC595 can it control a LCD screen.
Posted by smarcus3 on 23 April 2012 - 06:39 AM in General Discussion
#27901 Daisy Chain of Ic74HC595 can it control a LCD screen.
Posted by smarcus3 on 22 April 2012 - 06:21 PM in General Discussion
#27899 Daisy Chain of Ic74HC595 can it control a LCD screen.
Posted by smarcus3 on 22 April 2012 - 06:16 PM in General Discussion
#27898 Daisy Chain of Ic74HC595 can it control a LCD screen.
Posted by smarcus3 on 22 April 2012 - 06:13 PM in General Discussion
#27896 Daisy Chain of Ic74HC595 can it control a LCD screen.
Posted by smarcus3 on 22 April 2012 - 06:00 PM in General Discussion
Hi smarcus3,
It depends on the LCD and it's required speed. Can you specify which LCD?
I was hoping you would see this.
Its this one, HERE
#27893 Transistors and resistors
Posted by smarcus3 on 22 April 2012 - 05:39 PM in General Discussion
#27891 Daisy Chain of Ic74HC595 can it control a LCD screen.
Posted by smarcus3 on 22 April 2012 - 05:22 PM in General Discussion
[code=auto:0]Ic74HC595Chain ChainOut = new Ic74HC595Chain(SPI_Devices.SPI1, Pins.GPIO_PIN_D9, 2)/code]
The daisy chain wiring is shown HERE
#27870 PC rebooting on NetduinoPlus Disconnect
Posted by smarcus3 on 22 April 2012 - 06:39 AM in Beta Firmware and Drivers
#27869 Transistors and resistors
Posted by smarcus3 on 22 April 2012 - 06:39 AM in General Discussion
#27855 PC rebooting on NetduinoPlus Disconnect
Posted by smarcus3 on 21 April 2012 - 09:35 PM in Beta Firmware and Drivers
#27854 Transistors and resistors
Posted by smarcus3 on 21 April 2012 - 09:32 PM in General Discussion
#27847 PC rebooting on NetduinoPlus Disconnect
Posted by smarcus3 on 21 April 2012 - 08:28 PM in Beta Firmware and Drivers
#27838 Transistors and resistors
Posted by smarcus3 on 21 April 2012 - 06:50 PM in General Discussion
#27833 Transistors and resistors
Posted by smarcus3 on 21 April 2012 - 06:24 PM in General Discussion
#27832 Transistors and resistors
Posted by smarcus3 on 21 April 2012 - 06:10 PM in General Discussion
#27803 Transistors and resistors
Posted by smarcus3 on 21 April 2012 - 10:25 AM in General Discussion
#27802 PC rebooting on NetduinoPlus Disconnect
Posted by smarcus3 on 21 April 2012 - 10:19 AM in Beta Firmware and Drivers
#27801 Transistors and resistors
Posted by smarcus3 on 21 April 2012 - 10:16 AM in General Discussion
#27800 Transistors and resistors
Posted by smarcus3 on 21 April 2012 - 10:15 AM in General Discussion
#27795 PC rebooting on NetduinoPlus Disconnect
Posted by smarcus3 on 21 April 2012 - 08:34 AM in Beta Firmware and Drivers
#27792 PC rebooting on NetduinoPlus Disconnect
Posted by smarcus3 on 21 April 2012 - 07:42 AM in Beta Firmware and Drivers
#27790 PC rebooting on NetduinoPlus Disconnect
Posted by smarcus3 on 21 April 2012 - 07:27 AM in Beta Firmware and Drivers
#27596 Timeout the execution of a function
Posted by smarcus3 on 18 April 2012 - 10:34 PM in General Discussion
#27579 Timeout the execution of a function
Posted by smarcus3 on 18 April 2012 - 07:50 PM in General Discussion
Here is the helper class
using System; using System.Threading; using System.Runtime.Remoting; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using System.IO; using System.Text; using Toolbox.NETMF.NET; using System.Diagnostics; namespace EmailStockChecker { public class clWebpageHelper { private static string _rawData = ""; private static string _url = ""; private static string _pageLocation = ""; //ALLOWS FOR A MAXIMUM OF 10 SECONDS FOR THE THREAD TO FINISH BEFORE IT IS KILLED. private static int _maxTimeOut = 10 * 1000;//5 * 1000; private static Thread newThread = new Thread(new ThreadStart(Work)); //public static void SetWebPage(string url, string pageLocation) //{ // _url = url; // _pageLocation = pageLocation; // _rawData = ""; // //newThread = new Thread(new ThreadStart(Work)); //} public static void SetMaxTimeOut(int microseconds) { _maxTimeOut = microseconds; } public static string GetRawData(string url, string pageLocation) { _url = url; _pageLocation = pageLocation; _rawData = ""; newThread = new Thread(new ThreadStart(Work)); newThread.Start(); if (newThread.Join(_maxTimeOut + _maxTimeOut)) { //Debug.Print("UPDATE: JOINED"); } else { Debug.Print("ERROR: TIMED OUT"); newThread.Suspend(); newThread = new Thread(new ThreadStart(Work)); //newThread.Abort(); } return _rawData; } private static void Work() { _rawData = GetOnlineWebPage(_url, _pageLocation); //Debug.Print("UPDATE: WORK THREAD COMPLETE"); } public static string GetOnlineWebPage(string url, string pageLocation) { /* THIS FUNCTION GETS ONLINEWEBPAGES AS LONG AS THEY ARE NOT HTTPS. THE NETDUINO AT THIS POINT DOESNT * HANDLE DEALING WITH HTTPS PAGES OR SSL. THE WORK AROUND TO THIS IS TO USE AN PHP WEBSITE. THE FUNCITON * RETURNS THE ENTIRE WEBSITE AS A LONG, LONG STRING. ALL OF THE HTML WILL BE RETURNED WITH THIS FUNCTION * SUCH AS HEADER AND BODY BREAKS. THIS FUNCTION GOES HAND IN HAND WITH GETSTRINGINBETWEEN * * INPUT: URL ---> A STRING WHICH CONTAINS THE URL OF THE SITE SUCH AS HTTP://WWW.GMAIL.COM * * OUTPUT: A STRING WHICH CONTAINS ALL THE RAW DATA OF THE WEBSITE * * SAMPLE CALL: clMisc.getOnlineWebPage("www.smarcus3.x10.mx"); * * BASED ON THE INTEGRATEDSOCKET EXAMPLE */ //string Text = ""; try { Debug.Print("WEBPAGE: " + url + pageLocation + " ATTEMPTING TO GET"); StringBuilder sb = new StringBuilder(); // Defines the socket, including the remote host and port SimpleSocket Socket = new IntegratedSocket(url, 80); //SimpleSocket Socket = new IntegratedSocket("www.smarcus3.x10.mx", 80); // Connects to the socket Socket.Connect(); // /ig/api?stock=EEM for finance // / for the root file i.e. emails // Does a plain HTTP request Socket.Send("GET " + pageLocation + " HTTP/1.1\r\n"); Socket.Send("Host: " + Socket.Hostname + "\r\n"); Socket.Send("Connection: Close\r\n"); Socket.Send("\r\n"); // Prints all received data to the debug window, until the connection is terminated and there's no data left anymore while (Socket.IsConnected || Socket.BytesAvailable > 0) { sb.Append(Socket.Receive()); } // Closes down the socket Socket.Close(); Debug.Print("WEBPAGE: " + url + pageLocation + " GRABBED"); return sb.ToString(); } catch { Debug.Print("ERROR: FAILED TO START TO GRAB WEB PAGE: " + url + pageLocation); return ""; } } } }
Here is how you call it in a function such as in the main function
clWebpageHelper.GetRawData("www.google.com", "/")
- Netduino Forums
- → smarcus3's Content
- Privacy Policy