FemtoBasic versions for Prop BOE & Activity Board
Mike Green
Posts: 23,101
In honor of receiving a Propeller Board of Education, I've made some very minor changes to the QSBasic I posted recently to make it work with the Propeller Board of Education. I added I2C statements to allow reading and writing data to I2C devices like the BOE's ADC. I plan to add simple support for the BOE's DAC as well. Note that the micro-SD card driver only handles FAT16, so keep card sizes to 2GB or less and format them as FAT16, preferably with 32K clusters.
Updated archive. I2C statement changed to use 100KHz I2C bus speed. There were occasional errors with non-EEPROM devices at the higher 400KHz speed.
Updated 2012-03-25. SERVO statement now works properly. PING may or may not work properly ... needs more testing. Works with xBee (two compiled versions provided.
Updated 2012-03-26 Small changes to PING code and documentation.
Updated 2012-03-27 Rewrote BOEBOT.BAS example to run under PropBOEBasic. This is a modified "Roaming with PING" example.
See Post #11 for Activity Board version
Updated archive. I2C statement changed to use 100KHz I2C bus speed. There were occasional errors with non-EEPROM devices at the higher 400KHz speed.
Updated 2012-03-25. SERVO statement now works properly. PING may or may not work properly ... needs more testing. Works with xBee (two compiled versions provided.
Updated 2012-03-26 Small changes to PING code and documentation.
Updated 2012-03-27 Rewrote BOEBOT.BAS example to run under PropBOEBasic. This is a modified "Roaming with PING" example.
See Post #11 for Activity Board version
Comments
Update: See first post for current version. SERVO works with any of the servo headers (I/O pins 14 - 19).
For example, if you've plugged the left servo into the I/O pin 16 header and the right servo into the I/O pin 17 header, the following will set both servos to the midpoint of their range for calibration.
Here is sample Femto code to drive a PCA9554 Buss Expander.
I added the I2C command to my cobbled up version of DongleBasic.
Works nicely!
Duane J
Mike,
Doesn't the PropBOE have a 3.9K resistor on the signal pin of the 6 P14-P19 3pin headers already? This is needed only if you don't want to connect the ping to one of the standard 3 pin headers. Correct
Just got my board a few days ago and have not had a chance to play with it yet.
Jim
Here's the schematic http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/32900_PropBOE_RevA_Schematic.pdf and on page 5 it looks like you are correct. That certainly makes connecting a Ping))) to the three pin header much easier. I think it also helps attenuate servo noise, which I've noticed seems to be more problematic with a 3.3v device and a single power supply.
Edit: Changed ADC channel numbers from 1-4 to 0-3 to match labels on Activity Board. Added DAC statement to set DAC channels 0 (audio Right) or 1 (audio Left) to a value from 0-255 to provide voltages from 0 - 3.3V with 8-bit resolution and a PWM frequency of 22KHz. This uses PhiPi's PWM object from the ObEx.