• Importing & using external libraries

    Getting Started micropython
    6
    0 Votes
    6 Posts
    3k Views
    G
    @bucknall Thanks. Using the MicroPython Interpreter I use the built-in serial terminal on Mac OS known as 'screen' to open a USB serial connection to the Pycom Device. Maybe a stupid question, but why do you serial connect to the xxPy (using eg screen on Mac, the alternative on win I suppose is Putty or TeraTerm)? Pymakr itself has already a serial connection the xxPy? Additionally isn't writing your code as part of a project (in Pymakr) followed by ftp'ing (FileZilla or other) the code/firmware from the Mac or win PC to the xxPy not enough? Also, when clicking (in Pymakr) "Run this code' what exactly happens, isn't clear to me? Should I first ftp the code to the xxPy and then click "Run this code", but if so I'm asking myself why, because when you reset the xxPy the code/firmware runs from the xxPy? Thanks. Guy
  • EXPORT CODE FROM ARDUINO TO PYMAKR

    Pymakr sipy pymakr micropython
    5
    0 Votes
    5 Posts
    3k Views
    C
    Take a look to an arduino like wrapper for pycom at https://github.com/dinosd/pyCom/blob/master/examples/arduino_sample.py import arduino estado = 0 estado2 = 0 cont = 0 A = 10 B = 11 C = 12 D = 13 E = 14 def setup(): arduino.pinMode(15, "ANALOG_INPUT") #PIN P15, there is no mode analog input in arduino but pycom needs it arduino.pinMode(8, "INPUT") # modes are "INPUT","OUTPUT","INPUT_PULLUP","INPUT_PULLDOWN","ANALOG_INPUT" arduino.pinMode(7, "INPUT") arduino.pinMode(A, "OUTPUT") arduino.pinMode(B, "OUTPUT") arduino.pinMode(C, "OUTPUT") arduino.pinMode(D, "OUTPUT") arduino.pinMode(E, "OUTPUT") def loop(): global estado, estado2, cont value = arduino.analogRead(13) millivolts = 1100 * value / 1.1 #max volts for analog in is 1.1V db = millivolts / 10 print(db, "DB") estado2 = arduino.digitalRead(8) if estado2: #this means high or you can write if estado2==1 estado = arduino.digitalRead(7) if estado: arduino.delay(500) cont += 1 if cont==1: arduino.digitalWrite(A, 1) arduino.digitalWrite(B, 1) arduino.digitalWrite(C, 1) arduino.digitalWrite(D, 1) arduino.digitalWrite(E, 1) setup() while True: loop()
  • 3 Votes
    2 Posts
    2k Views
    R
    Any chance Pytrack will be released in time for this challenge?
  • 0 Votes
    4 Posts
    2k Views
    robert-hhR
    @paul12345 : I do not know why the implementation is recursive. Maybe it always was, or it's the most elegant solution. About the double quote: No, it does not work on WiPy if you drop the double quote at the end of the search string. But you will have a match on machines with more memory, simply because the sample string (line) you are searching at does not contain the pattern mp3". B.T.W.: Shortening the string in line works on WiPy. Regards, Robert
  • SofwareSerial library for micropython

    Discussion softwareserial micropython
    3
    0 Votes
    3 Posts
    2k Views
    C
    @robert-hh Thank you!