It's really not so complicated. The Windows extensions are just that--extensions--not differences.
If I was interested in Electronics and programming, with minimal existing skills in either, my preference would be: Arduino, then Linux on Small ARM board (e.g. Pi), then PC Linux and finally Windows.
Solid example - creating a burglar alarm alarm for a reed switch on a door, and make a noise when it is open. Code to support it
1. Arduino - nice and simple - and fully understandable.
setup()
{
PinMode(1,INPUT); -- to switch in door;
PinMode(2, OUTPUT); -- to beeper
}
loop()
{
if(DigitalRead(1) = 0)
{
// Waggle the beeper
DigitalWrite(2,1);
delay(1);
DigitalWrite(2,0);
delay(1);
}
else
delay(1);
}
2. On small Linux box, after a bit of cut-and-paste from various pages. Quite a bit of black magic
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#define MODE_FILE_FORMAT "/sys/devices/virtual/misc/gpio/mode/gpio%d"
#define PIN_FILE_FORMAT "/sys/devices/virtual/misc/gpio/pin/gpio%d"
int main(int c, char *v[])
{
char buffer[128];
FILE *modefile, *pinfile;
int pin;
if(c != 2) {
fprintf(stderr,"usage: %s [pin]\n",v[0]);
exit(2);
}
pin = 1;
/* Open the GPIO control files */
sprintf(buffer,MODE_FILE_FORMAT,pin);
modefile = fopen(buffer,"w");
if(modefile == NULL)
{
fprintf(stderr,"Unable to open mode file: %s\n",buffer);
exit(2);
}
sprintf(buffer,PIN_FILE_FORMAT,pin);
pinfile = fopen(buffer,"r");
if(pinfile == NULL)
{
fprintf(stderr,"Unable to open pin file: %s\n",buffer);
exit(2);
}
/* Set the pin to be an input pin */
fwrite("0",1,1,modefile);
/* Read and display the value of the GPIO pin */
while(1)
{
char buffer[4];
fseek(pinfile, 0, SEEK_SET);
if(fread(buffer,1,4,pinfile) <= 0) {
fprintf(stderr,"Error on read\n");
break;
}
if(buffer[0] = '0')
system("aplay alarm.wav");
usleep(100000);
}
fclose(modefile);
fclose(pinfile);
return 0;
}
3. On PC Linux box, just like 2, but with no Hardware GPIO pins to play with, so find something like
http://numato.com/32-channel-usb-gpio-module and adapt the code to it. A bit more black magic and very few hits in Google for howtos.
4. On Windows
First, work out what you are trying to do (which is hard when you don't know what you are doing)
Then find and buy a GPIO board - which will cost more than an Arduino.
Then read a lot on how to access the GPIO pins (usually involves importing DLLs and other tricks) and custom setting in the build environment
Then work out how to play sounds through the Win32 API multimedia interface
Then work out how to use timers to check the pin at regular intervals.
Then finally start writing code - something as newbie-incomprehensible as this, but would include calls to "PlaySound(TEXT("recycle.wav"), NULL, SND_FILENAME);" and some thing to do the timer.
Then write code like this, where the actual code that does real work ("SetPinLevel(133, 0);") looks pretty much the same as the Arduino code:
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices; ///< To use Toradex C Win32 DLLs
namespace GPIO_LED
{
public partial class Form1 : Form
{
[DllImport("GPIOLib.dll", CharSet = CharSet.Auto)] ///< Importing DLL
public static extern bool SetPinAltFn(Int32 pinNum, Int32 altFn, bool dirOut); ///< External function declaration
[DllImport("GPIOLib.dll", CharSet = CharSet.Auto)]
public static extern void InitGPIOLib();
[DllImport("GPIOLib.dll", CharSet = CharSet.Auto)]
public static extern bool SetPinLevel(Int32 gpioNum, Int32 val);
[DllImport("GPIOLib.dll", CharSet = CharSet.Auto)]
public static extern void DeInitGPIOLib();
public Form1()
{
InitializeComponent();
SetPinAltFn(133, -1, true); ///< To set the SODIMM_133 as GPIO output
}
private void button1_Click(object sender, EventArgs e)
{
SetPinLevel(133, 1); ///< Sets SODIMM_133 as high when button1 is pressed
}
private void button2_Click(object sender, EventArgs e)
{
SetPinLevel(133, 0); ///< Sets SODIMM_133 as low when button2 is pressed
}
private void FormClose(object sender, EventArgs e)
{
DeInitGPIOLib(); ///< Deinitializes GPIO library and frees up system resources upon closing the program
}
}
}
Which takes me back to my original advice - if you want to play around with programming and electronics then don't use your PC - buy and Arduino starter kit.