Hi all, this isn't a big thing but it's something others may be interested in. I've been interested in using Blitz along with homebrew electronics, so I picked up an Arduino:
http://www.arduino.cc/
Using Nigel Brown's comm module ( http://www.nigelibrown.pwp.blueyonder.co.uk/blitz/userlibs/index.htm ) I've been communicating between the Arduino board and Blitz. As a bare beginning to anyone interested in playing with this, here's how to turn an LED on/off by hitting the spacebar. Obviously this is a pretty small start, and rather pointless on its own; this is basically a "Hello World!"
First follow these directions to get the Arduino setup:
http://www.ladyada.net/learn/arduino/lesson0.html
http://www.ladyada.net/learn/arduino/lesson1.html
Now upload this program to the board (the firmware):
Finally run this code in BlitzMax (as mentioned above, get brown.comm from Nigel's website):
Using this along with miniB3D could make for some very interesting physical interfaces. Arduino is useful for working with all sorts of input devices (pressure sensors, light meters, whatever) as well as output devices (lights, motors, etc.)
I figure my next step will be to make things work with the Firmata standard that people have been developing; it's a standard firmware for Arduino so that you don't have to worry about programming the hardware.
http://www.arduino.cc/
Using Nigel Brown's comm module ( http://www.nigelibrown.pwp.blueyonder.co.uk/blitz/userlibs/index.htm ) I've been communicating between the Arduino board and Blitz. As a bare beginning to anyone interested in playing with this, here's how to turn an LED on/off by hitting the spacebar. Obviously this is a pretty small start, and rather pointless on its own; this is basically a "Hello World!"
First follow these directions to get the Arduino setup:
http://www.ladyada.net/learn/arduino/lesson0.html
http://www.ladyada.net/learn/arduino/lesson1.html
Now upload this program to the board (the firmware):
int ledPin = 13; int msg; void setup() { Serial.begin(9600); pinMode(ledPin, OUTPUT); } void loop() { if(Serial.available() > 0) { msg=Serial.read(); if(msg==1) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } } }
Finally run this code in BlitzMax (as mentioned above, get brown.comm from Nigel's website):
Import brown.comm Graphics 640,480 Global msg:Byte=0 Global port:TComm = New TComm port.Open(3) port.Set("baud=9600 parity=N data=8 stop=1") While Not KeyHit(KEY_ESCAPE) Cls DrawText "Press SPACE to toggle LED",10,10 If KeyHit(KEY_SPACE) msg:+1 msg = msg Mod 2 port.WriteByte(msg) EndIf DrawText msg,10,40 Flip Wend port.Close() End
Using this along with miniB3D could make for some very interesting physical interfaces. Arduino is useful for working with all sorts of input devices (pressure sensors, light meters, whatever) as well as output devices (lights, motors, etc.)
I figure my next step will be to make things work with the Firmata standard that people have been developing; it's a standard firmware for Arduino so that you don't have to worry about programming the hardware.