https://github.com/alvieboy/ZPUino-HDL.
To change your current checkout, do:
git remote add github git://github.com/alvieboy/ZPUino-HDL.git
git fetch github
git branch --set-upstream master remotes/github/master
All should work, I hope.
Alvie
git remote add github git://github.com/alvieboy/ZPUino-HDL.git
git fetch github
git branch --set-upstream master remotes/github/master
#include <SerPro3.h>
#include <SPI.h>
#include <Papilio.h>
SERPRO_ARDUINO_BEGIN();
Papilio::ADC8_Wing myadc;
void setup()
{
Serial.begin(115200);
myadc.begin( Papilio::Wing_A_Low );
}
uint16_t sample(int channel)
{
return myadc.sample(channel);
}
void loop()
{
if (Serial.available())
SerPro::processData(Serial.read());
}
EXPORT_FUNCTION(1,sample);
SERPRO_ARDUINO_END();
#include <SerPro/SerPro-glib.h>
SERPRO_GLIB_BEGIN();
IMPORT_FUNCTION(1,sample,uint16_t(int));
void go()
{
while(1) {
printf("Voltage: %.02f\n", ((double)sample(0)*3.3)/255.0 );
usleep(500000);
}
}
int main(int argc,char **argv)
{
SerProGLIB::init(argv[1],B115200);
SerProGLIB::start();
SerProGLIB::waitConnection();
go();
}
SERPRO_GLIB_END();
$ ~/sketchbook/remote/pc/remote /dev/ttyUSB1
Channel set up OK
Voltage: 1.20
Voltage: 1.20
Voltage: 1.20
Voltage: 1.20
Voltage: 1.20
Press ENTER to start benchmark
Doing 10000 runs...
Time: 1536 milisseconds, 104166 bytes/s
Press ENTER to start benchmark
Doing 10000 runs...
Time: 2101 milisseconds, 76154 bytes/s