Go to advanced search

by hippy
Thu Aug 05, 2021 1:27 pm
Forum: General
Topic: Pico as USB display?
Replies: 54
Views: 2213

Re: Pico as USB display?

Whoot! Not exactly sure which or what incantations got it working but it does, and without changes to my test code or MicroPython module - from machine import mem16 import gud import time width, height, fb, cb, tb, flags = gud.info() def rgb565(r, g=None, b=None): def Encode(n, msk, shl): return (n...
by hippy
Thu Aug 05, 2021 12:48 pm
Forum: MicroPython
Topic: program runs once and gives either an error or stop running(executes one part of a program,the other parts don't respond
Replies: 12
Views: 178

Re: program runs once and gives either an error or stop running(executes one part of a program,the other parts don't res

here is the output we recieve Alarm! sensor_dig2! bluelock access! As "Alarm! sensor_dig2!" and "bluelock access!" are generated in two separate parts of the routine, it appears "pir_handler" is being called multiple times, that multiple callbacks are working as expect...
by hippy
Thu Aug 05, 2021 12:37 pm
Forum: MicroPython
Topic: program runs once and gives either an error or stop running(executes one part of a program,the other parts don't respond
Replies: 12
Views: 178

Re: program runs once and gives either an error or stop running(executes one part of a program,the other parts don't res

here is the output we recieve Alarm! sensor_dig2! bluelock access! b'AT\r\r\nOK\r\n' b'AT+CSQ\r\r\n+CSQ: 14,0\r\n\r\nOK\r\n' b'AT+CMGF=1\r\r\nOK\r\n' b'AT+CMGS="+..........."\rDOOR OPENED\r\r\n> ' b'' It would seem that in response to initiating the sending of an SMS the GSM module is han...
by hippy
Thu Aug 05, 2021 10:13 am
Forum: MicroPython
Topic: Micro Python without USB
Replies: 2
Views: 138

Re: Micro Python without USB

While it won't currently help you it might help later or maybe others - Other boards without USB run MicroPython so it should be possible to remove what was added to the RP2 port to provide USB. Hopefully the USB hardware will initialise such that it's not active but one may need to explicitly deact...
by hippy
Thu Aug 05, 2021 9:27 am
Forum: MicroPython
Topic: program runs once and gives either an error or stop running(executes one part of a program,the other parts don't respond
Replies: 12
Views: 178

Re: program runs once and gives either an error or stop running(executes one part of a program,the other parts don't res

There are two potential problems I can see which may cause the program not to work as expected; the pin.value() may not actually be high when the callback handler is entered, and further callbacks may be ignored or dropped until the callback handler completes - I haven't tested that last possibility...
by hippy
Wed Aug 04, 2021 2:54 pm
Forum: General
Topic: Pico as USB display?
Replies: 54
Views: 2213

Re: Pico as USB display?

No joy with 'fbi' .... pi@Pi3B:~ $ fbset -fb /dev/fb1 -match pi@Pi3B:~ $ sudo fbi -d /dev/fb1 lovelace.jpg using "Liberation Mono-16", pixelsize=16.67 file=/usr/share/fonts/truetype/liberation2/LiberationMono-Regular.ttf ioctl VT_GETSTATE: Inappropriate ioctl for device (not a linux consol...
by hippy
Wed Aug 04, 2021 2:12 pm
Forum: General
Topic: Pico as USB display?
Replies: 54
Views: 2213

Re: Pico as USB display?

Thanks again. 'modetest' works, and 'monitor.py' seems to be showing controller and display being enabled (1) so I might have some more digging to do as to why I am not seeing them. Will also look at 'fbi' etc. Yes; it is a small 32x24 buffer - I wanted something I could show in the Thonny shell win...
by hippy
Wed Aug 04, 2021 1:36 pm
Forum: General
Topic: Pico as USB display?
Replies: 54
Views: 2213

Re: Pico as USB display?

Thanks. No joy with "fbset -match" but I cannot discount that I may have some bug in my implementation. I was quite surprised it has been as easy as it has been as, from some comments elsewhere, I was expecting to run into vendor command issues with TinyUSB. Given the host can find the GUD...
by hippy
Wed Aug 04, 2021 12:05 pm
Forum: General
Topic: Pico as USB display?
Replies: 54
Views: 2213

Re: Pico as USB display?

Is anyone doing anything with GUD on a Pico, interested in taking on that adventure, helping to get things to work ? I have a GUD display implemented within MicroPython, an internal frame buffer which can be set by the host. It presents itself as a GUD device, /dev/fb1 is created, and I can see comm...
by hippy
Wed Aug 04, 2021 11:21 am
Forum: MicroPython
Topic: Speed measurement on a Triton router
Replies: 34
Views: 880

Re: Speed measurement on a Triton router

Very neat solution. I think it can still be done with 2 cycles per loop by changing the low counting loop to: label("lowloop") jmp(pin, "done") # 1 jmp(x_dec, "lowloop") # 2 label("done") Even better. Thanks. I anticipated that might mean one less X counted b...
by hippy
Wed Aug 04, 2021 11:07 am
Forum: MicroPython
Topic: Speed measurement on a Triton router
Replies: 34
Views: 880

Re: Speed measurement on a Triton router

In the test section you only define the output and the pulse width for the PWM. I cannot find any definition of the frequency. What does the PWM generator do if only the pulse width is specified? I forgot to answer that earlier. Fact is I don't know, am not even sure why what I have works. Truth is...
by hippy
Wed Aug 04, 2021 9:43 am
Forum: MicroPython
Topic: Speed measurement on a Triton router
Replies: 34
Views: 880

Re: Speed measurement on a Triton router

I find that measuring the time between the same-type edges using PIO is surprisingly hard. I didn't find it too bad in the end. It would have been nice to have jump on pin low as well as jump on pin high, but it's not so hard to keep the loop times for high and low periods the same number of cycles...
by hippy
Tue Aug 03, 2021 12:23 pm
Forum: MicroPython
Topic: ctrl <Z> command won't respond on micropython thonny
Replies: 16
Views: 363

Re: ctrl <Z> command won't respond on micropython thonny

KAG Tech wrote:
Mon Aug 02, 2021 10:35 am

Code: Select all

... snip ...
And ... ?

It's not really much use posting code if you don't indicate why you are posting that code.
by hippy
Tue Aug 03, 2021 12:19 pm
Forum: SDK
Topic: Bug with Pico timestamping function
Replies: 2
Views: 125

Re: Bug with Pico timestamping function

This suggests that the origin of the problem is likely to be found in an area of library code that is common to the sleep_us() and get_absolute_time() functions. I don't know if it is related but I have noticed MicroPython shows similar peculiarities when using sleep_us which are not present when u...
by hippy
Tue Aug 03, 2021 11:11 am
Forum: MicroPython
Topic: Combining 2 Programs
Replies: 5
Views: 348

Re: Combining 2 Programs

KAG Tech wrote:
Tue Aug 03, 2021 8:14 am
at first I kept getting "<stdin>" errors therefore I had to use "utime.sleep" on some parts of the script and it worked well.
Very odd. 'time' and 'utime' should effectively be synonymous in this code. But I guess it doesn't matter providing what you have works.
by hippy
Tue Aug 03, 2021 11:04 am
Forum: MicroPython
Topic: Speed measurement on a Triton router
Replies: 34
Views: 880

Re: Speed measurement on a Triton router

The time base is implicit in the counting. The Python equivalent would be - def PioFunction(): X = 0 while btn.value() != 0: pass while btn.value() != 1: pass # Edge detected - Start counting while btn.value() == 1: X = X - 1 Push(X) Which of course made me realise it's measuring the length of a hig...
by hippy
Tue Aug 03, 2021 10:40 am
Forum: SDK
Topic: Timing a function's execution time.
Replies: 5
Views: 169

Re: Timing a function's execution time.

I would usually do - start=time_us_64(); Do_something(); end=time_us_64(); time_taken = end - start; That makes it more certain that an end time will be obtained immediately after the 'Do_something' call. While the call to 'time_us_64()' may well be the first thing to be executed when the 'time_take...
by hippy
Tue Aug 03, 2021 10:25 am
Forum: General
Topic: alarm triggered, automatically trigger sim800l to send an sms
Replies: 10
Views: 295

Re: alarm triggered, automatically trigger sim800l to send an sms

hi, the deadline is on Friday In my work I have to advise students who have found themselves in the same position; where it looks unlikely that a project will be completed by the deadline. Much like B.Goode my advice is to have a Plan B for that eventuality; a way to present what you did achieve or...
by hippy
Tue Aug 03, 2021 9:53 am
Forum: General
Topic: Serial terminal project
Replies: 135
Views: 7837

Re: Serial terminal project

short-circuit evaluation of boolean. I'm not familiar with this term. That's where not all of a boolean expression is evaluated. It instead ends evaluation when it knows what the result would be. Consider - if (A or B) { printf("Is True"); } else { printf("Is False"); } Traditio...
by hippy
Mon Aug 02, 2021 8:04 pm
Forum: MicroPython
Topic: Speed measurement on a Triton router
Replies: 34
Views: 880

Re: Speed measurement on a Triton router

The two wait instructions "wait (0, pin, 0) and wait (1, pin, 1)" cause the measurement to be triggered each time a motor revolution, provided that first a low signal and then a high signal (as the actual Start of further routine)? Edge detection, so to speak? Exactly that. The second wil...
by hippy
Mon Aug 02, 2021 5:57 pm
Forum: General
Topic: Serial terminal project
Replies: 135
Views: 7837

Re: Serial terminal project

The things I have struggled with - and it rather depends on what the development language and compiled image provides or has to be DIY - is string support and arrays. Most times one can get by with only string literals, string variables pointing to a literal, no concatenation. Making a string variab...
by hippy
Mon Aug 02, 2021 5:18 pm
Forum: SDK
Topic: Setting PICO_SDK_PATH in your CMakeLists.txt (hint: dont)
Replies: 69
Views: 1787

Re: Setting PICO_SDK_PATH in your CMakeLists.txt (hint: dont)

It's an interesting question how to set up a project for the long term. My experience is that the bits rot slower if system dependencies are kept as far from the code as possible. This would suggest not copying any part of a vendor supplied SDK into the source tree. I can agree with both of those p...
by hippy
Mon Aug 02, 2021 4:32 pm
Forum: General
Topic: alarm triggered, automatically trigger sim800l to send an sms
Replies: 10
Views: 295

Re: alarm triggered, automatically trigger sim800l to send an sms

hi, thank you for responding back...this is our first time doing python ...honestly we have no clue none whatsoever ...we are beginners and are just attempting many things to get it working. we didnt do python programming as a module ..but we chose this project so we can learn something from it. we...
by hippy
Mon Aug 02, 2021 3:46 pm
Forum: SDK
Topic: Setting PICO_SDK_PATH in your CMakeLists.txt (hint: dont)
Replies: 69
Views: 1787

Re: Setting PICO_SDK_PATH in your CMakeLists.txt (hint: dont)

This doesn't really have much to do with PICO_SDK_PATH. I think it does. If not pulling PICO_SDK_PATH directly into CMakeLists.txt one must have a 'pico_sdk_import.cmake' in every directory and that is potentially problematic as has been acknowledged. So we should be making risk assessments on how ...
by hippy
Mon Aug 02, 2021 3:19 pm
Forum: MicroPython
Topic: Pi PICO USB HID device support in Micro Python?
Replies: 25
Views: 605

Re: Pi PICO USB HID device support in Micro Python?

I'd say 'perfect' would be means provided, and example code that is easy to customise included. Otherwise this keypad is no better suited to USB HIB use than any other keypad or set of buttons. It's got a Pico attached with a USB connector so it can be a HID device, which most other keypads can't b...

Go to advanced search