This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-04-24 10:46:15

Sergiutofanel
New Scratcher
Registered: 2013-04-24
Posts: 1

Sensor read via USB

I am fairly new to Scratch programming (actually, I discovered it last week), so bear with me if this is a stupid question. I have a PIC based data acquisition board that is configured as a USB HID device. It has 12 A/D channels and 8 digital I/O pins that can be used to read sensors and drive digital I/O pins.

Is there any way that such a device can be integrated into a Scratch project?

Offline

 

#2 2013-04-24 11:10:05

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Sensor read via USB

Sounds like you'll want to use Remote Sensor Connections, which lets you interface an external program with Scratch (1.4 only, not 2.0 beta).

Maybe try writing a Python script that reads data from the board and sends it as sensor updates to Scratch using scratchpy:

Code:

import scratch
s = scratch.Scratch()
s.connect()
s.sensorupdate({'temperature' : 75})

Things I've made: kurt | scratchblocks2 | this cake

Offline

 

Board footer