CMD A VALA B VALB
0000 0000 0000 0000 0000 0000 0000 0000
\ / \ / \ / \ / \ / \ /
SET DIO 5 VAR 4 ignored
- A,B are one of DIO, AO, PWM, TMR, user variable, value
#include <linux/serial.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#define TIOCGRS485 0x542E | |
#define TIOCSRS485 0x542F | |
int main(void) { | |
struct serial_rs485 rs485conf; |
/* cape-thermostat-00A0.dts | |
* Mar. 2014 | |
* | |
* Overlay for a simple thermostat cape. | |
* | |
* Created for Logic Supply's custom cape tutorial here: | |
* http://inspire.logicsupply.com/p/building-custom-cape.html | |
*/ | |
/dts-v1/; |
""" | |
dmx512.py | |
May, 2014 | |
Alexander Hiam <[email protected]> | |
A very basic DMX512 implementation made for the BeagleBone and | |
BeagleBone Black. | |
DMX512 class should be instantiated with a PyBBIO serial port object, | |
e.g.: |
root@beaglebone:~/pruspeak/src/driver# insmod ./pru_speak.ko | |
root@beaglebone:~/pruspeak/src/driver# lsmod | grep pru | |
pru_speak 22648 0 | |
root@beaglebone:~/pruspeak/src/driver# ls /lib/firmware/ | grep pru | |
pru_firmware | |
root@beaglebone:~/pruspeak/src/driver# echo BB-BONE-PRU-07 > $SLOTS | |
root@beaglebone:~/pruspeak/src/driver# cat $SLOTS | |
0: 54:PF--- | |
1: 55:PF--- | |
2: 56:PF--- |
newid | |
4bc749bdf3c50b199945 | |
4bc749bdf3c50b199945 | |
4bc749bdf3c50b199945 | |
4bc749bdf3c50b199945 | |
4bc749bdf3c50b199945 | |
4bc749bdf3c50b199945 | |
4bc749bdf3c50b199945 |
<p>Hello, World!<br></p> |
<p>Test<br></p> |
SCRIPT | |
SET period_ms, 100 // set inital value | |
SET ain_val, AIN[0] | |
WAIT period_ms | |
GOTO 1 | |
ENDSCRIPT | |
// When it's running you can change the sampling period with: | |
SET period_ms, x | |
// and get the value with: |
import serial, fcntl, struct, time | |
ser = serial.Serial( | |
port='/dev/ttyO4', | |
baudrate=9600, | |
timeout=1, | |
parity=serial.PARITY_NONE, | |
stopbits=serial.STOPBITS_ONE, | |
bytesize=serial.EIGHTBITS | |
) |