API Machine

c

Your C# program can send data to the Arduino using the serialport - it'll actually be a USB connection but it looks like COMn: to the C# code. Look at the the Serial class the Arduino has to see how to receive it.

At it's simplest, you can send a single character to the arduino every time the like count changes. For more flexibility, you'll likely want to actually send the count.

So I can simply create a method which sends a ON or OFF command to the Arduino? What if I want the Arduino to be a standalone project-so all of the functions occurs onboard.

bailfire: So I can simply create a method which sends a ON or OFF command to the Arduino? What if I want the Arduino to be a standalone project-so all of the functions occurs onboard.

  1. Yes.
  2. Depends how complex the API is. You can use a wifi or ethernet shield to connect to the internet & maybe replicate what your PC is doing. It wouldn't surprise me to discover that the API is using https though and I don't believe that's viable on a small arduino.

C

Well, that makes it easier. You'll have to parse the result yourself though. Look at the arduino's Ethernet library to see the methods available to you as a client: Ethernet

Is it possible to import namespaces into the Arduino IDE within Visual studio to allow functions?

thanks

I know you can use VS to program the arduino, though I've never done it, and I assume that you can declare your own namespace for your code, but if you're asking if you can use .net functionality on an arduino, the answer is no.

Try using the API from your computer without being logged into Facebook. I'd imagine that it won't work. Chances are, the server side code (on Facebooks server) will rely on session variables. These rely on cookies being available on the client side.

This is still possible but your code will have to store the session cooke recieved from the server and be prepared to pass it back when you access the API.