News and Announcements Embedded Systems cdt Projects pilot project Fatih Droid e-Reader for Linux Category Android Categories FPGA MCU / CPU Arduino STM32 beaglebo cdt to the MSP430 Embedded cdt Software CPU Turkey 2008 (CPU Design) Virtual Processor Design Physical Processor Design Academic Innovative Embedded System Design
Hi everyone, as I wrote in the previous cdt article in this article Stellaris Launchp, Energie and we will send Tweets using C #. If you are interested in a bit of basic applications with embedded systems, one button is pressed, the LED lighting applications la've encountered, in this paper we extend our work a little'll throw tweet button is pressed. This software are required; Visual Studio Stellaris LP Energia Twitter cdt tweet sent by a software to access cdt and attract, https://dev.twitter.com/apps to perform tasks such as application cdt from the link you need to create yourself a Twetter. To do this, we open the link, and we face the screen, we click the Create New App button. Your face will form as above. Here, on application by entering the information page by clicking the button below, we create applications. (Website section you can write http://www.twitter.co.) Then, we face the screen, select the Permissions tab to open the Reader and Writer are marked. Then open API Keys tab located at the bottom we click on the button Create my access token. Now everything is completed as software able to reach. First, open the Tools tab energie program Board and Serial Port settings are doing. Copy and paste the following code in our project we are after.
void setup () {Serial. begin (9600); In pinmo (PF_4, INPUT_PULLUP); } Void loop () {int I = digitalread butond (PF_4); if (I butond == LOW) {Serial. print ("Tweet trial"); delay (1000); }} Now let us explain what we are doing. First serial port settings made and butonu of that pin as an input redirect pull ups we got it on, it's because the button is pressed, the processor is so fast that, for example hand 10ms button cdt at the top depressed when stopped this 10ms dozens of times on the button like printed detect. Pull-up is used to prevent this situation. LOW then the button that you read the serial port logic state 0 "Tweet Trial" We sent the article. Here you can draw your attention LOWER part. The reason for this is: Button processor as the default logic one value ie continuous paths HIGH value, the button is pressed the send button starts the logic value 0. Later we value to serial port with C # as the roads will tweet is worth taking. Finally, just in case the value of the button to send more than one processor to prevent've waited one second. Place the longest section came. Before proceeding to the C # code in Visual Studio, we have to make some settings. VS C # Express was enough for us in my last article. In this article we are going to do some downloads Full version will use the Visual Studio. Download and install the program from the link I gave above, then you can follow the steps given below. After you open Visual Studio programs are opening a new application form. If you open the application forms do not have information about the link I gave you can read the article. Then, the program Extensions Manager from the Tools tab located above the 'i we choose. Online cdt NuGet Package Manager tab, then click Locate and install. (Note: You use this window may be some differences depending on the version.) After you install this package, we no longer need to send a Tweet libraries involved in the project, we can download. Located to the right of the screen in the Solution Explorer window, right click on the References tab and we Manage NuGet Packages' s we choose. We face the window again, select the Online tab in the search box "Tweet" writing of the results tweetsharp 's are downloading. After this stage, we're almost done counted. Now we come to the code window and double-click to form these codes are sticking wipe out everything.
using System; using System. Windows. Forms; using System. IO. Ports; tweetsharp using; windowsformsapplication1 namespace {public partial class Form1: Form {public Form1 () {InitializeComponent (); Serialport1} cdt SerialPort = new SerialPort ("COM5", 9600); by twitterservi of service = new twitterservi ("API key will be pasted here", "API cdt secret to be pasted here", "Access token will be pasted cdt here", "Access level to be pasted here"); private cdt void Form1_Load (object sender, EventArgs e) {serialport1. Open (); serialport1. DataReceived + = serialport1_datareceived; cdt Serialport1_datareceived} private void (object se
No comments:
Post a Comment