Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Pi-cromite V5.4.05 with documentation Post ReplyPost New Topic
<< Prev Page of 5
Author
Message << Prev Topic | Next Topic >>
RonnS
Regular Member
Regular Member


Joined: 16 July 2015
Location: Germany
Online Status: Offline
Posts: 81
Posted: 21 September 2017 at 5:13am | IP Logged Quote RonnS

hello Matherp,

what do you think about a command to reading an analog Value ?
such is available with Python ( as a Library ) by using as an example the "EnviroHat "
they are using the ADS1015 4-channel 3.3v, analog to digital sensor (ADC)
Link


best regards Ron

PS: this would make the Picromite fully compatible to mmbasic..

Edited by RonnS on 21 September 2017 at 5:16am



Back to Top View RonnS's Profile Search for other posts by RonnS
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 1834
Posted: 21 September 2017 at 7:49am | IP Logged Quote matherp

Quote:
what do you think about a command to reading an analog Value ?
such is available with Python ( as a Library ) by using as an example the "EnviroHat "
they are using the ADS1015 4-channel 3.3v, analog to digital sensor (ADC)


Great idea - I've ordered one
Back to Top View matherp's Profile Search for other posts by matherp
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 1834
Posted: 22 September 2017 at 2:38pm | IP Logged Quote matherp

Please find attached a new version 5.4.09

2017-09-22_141850_Pi-cromite_Manual.pdf

2017-09-22_142121_mmbasic.zip

This version includes a new command and supporting function

FORK unix_command
FORK KILL
MM.FORK

FORK is similar to SYSTEM except that it is non-blocking and all output from the new process is sent to the null device. This allows MMBasic to run a Linux process in the background

MM.FORK returns the process ID of the forked process or zero if no process exists. Only one forked process is allowed at a time.

If this all seems rather esoteric then a simple example should illuminate things:


SetPin 3,din,pullup 'set up a pin to halt playback
Fork aplay gold.wav 'play a wav file using a standard Pi command
Do While MM.Fork 'loop while playback continues
  If(Pin(3)<>1) Then 'check the stop switch
    Fork kill 'kill the forked process
  End If
Loop


Note that the unix command does not need quotes or specific field separators but commas may be used instead of spaces if preferred. Note also that the C-library parser does not accept "-" characters in filenames as these are treated as specific to command syntax.

NB: there is a known issue with the Pi-cromite relating to use of the I2S audio. When MMBasic exits I2S audio playback will stop even if started from the Linux command line before MMBasic is run. This is caused by something internal to the PIGPIO C I/F. I have reported this to the author of PIGPIO but it is not something I can fix myself.

Back to Top View matherp's Profile Search for other posts by matherp
 


If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Search the forums using Google.
<< Prev Page of 5
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1094 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.11