Commit 190bfc15caca23214a76164766171706fc20535a

Authored by grouille
1 parent 907e2ddf

MAJ

Showing 2 changed files with 33 additions and 1 deletions   Show diff stats
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import serial 3 import serial
4 -ser = serial.Serial('/dev/ttyACM0', 9600) 4 +ser = serial.Serial('/dev/ttyACM0', 9600, timeout=1)
5 while 1: 5 while 1:
6 print(ser.readline()) 6 print(ser.readline())
test.c 0 → 100644
@@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
  1 +#include <stdio.h>
  2 +#include <stdlib.h>
  3 +#include <Serial.h>
  4 +#include <unistd.h>
  5 +
  6 +//#define rxPin 0
  7 +//#define txPin 1
  8 +
  9 +//SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
  10 +
  11 +void setup()
  12 +{
  13 + //DDRD = 0x02;
  14 + Serial.begin(9600);
  15 +}
  16 +
  17 +void loop()
  18 +{
  19 + //if(mySerial.available() > 0)
  20 + //{
  21 + Serial.println('A');
  22 + //}
  23 +}
  24 +
  25 +int main(void)
  26 +{
  27 + while(1)
  28 + {
  29 + loop();
  30 + _delay_ms(2000);
  31 + }
  32 +}