How to "Mock" an adaptor on windows ?

9 views
Skip to first unread message

Steeve Dess

unread,
Sep 27, 2019, 3:19:07 AM9/27/19
to gobotio
Hi,

Golang is multi platform, so I can code on my windows 10 with vscode as I like it, and run my program on another platforms, like in my case, a linux raspbian on a raspberry pi.

I'm working on a prototype of an api to controle 16 servo motors thru a PCA9685 module connected with a raspberry pi.

I started to develop my API under windows, until I added the gobot adaptor raspi. Since I'm not able to compile my program under windows, but only on  the raspbian.

I looked for a way to tell my program that the electronic part wil not be active if the adaptor is not present, I didn't find a way to do it.

I assumed that it's because the raspi adaptor code is coded to compile only under a linux platform. I may be wrong , of course !

So I thought It would be great to be able to "mock" the raspi adaptor => of course the electronic and GPIO and I2c part will not run, but the go program would be able to compile under all platforms and the rest api part would work fine.

Do you have any infos, ideas about this subject ?

Regards

Steeve
Reply all
Reply to author
Forward
0 new messages